나는 나와 함께 겪고있는 오류를 설명하기에 적절한 어휘를 가지고 있는지 확신하지 못합니다.아무 것도 반환되지 않을 때 몽고 텍스트 인덱스가 끝나지 않습니다.
여기
{
_id: ObjectId(),
name: String,
business: String,
address: {
search_type: Character,
address: String,
city: String,
state: String,
zip: Number
}
}
나는 그래서 그 내 컬렉션에 필드에 대한 텍스트 인덱스를 만든 address.search_type
에 따라 검색하고 싶었 내 컬렉션에 문서에 대한 일반적인 스키마입니다.
{
v: 1,
key: { _fts: 'text', _ftsx: 1 },
name: 'address.search_type_text',
ns: 'admin.customer',
default_language: 'none',
weights: { 'address.search_type': 1 },
language_override: 'language',
textIndexVersion: 3
}
지금 내 데이터가 정말에만 검색 유형으로 C, G, 또는 T가 있어야 내가 지원 search_types 중 하나가이 컬렉션에 찾기 쿼리를 실행할 때 쿼리가 잘 실행하는 것을 알고있다.
db.collection('blah').find({'address.search_type':'C'}).limit(10).toArray(function(err, result){
if(err) console.log(err);
else console.log(result[0]);
db.close();
});
하지만 0 문서 내 쿼리 중 하나를 완료하거나 시간 초과 결코를 반환해야 address.search_type
이 쿼리를 실행할 때.
문서가 0 일 때 내 쿼리가 실행되지 않거나 시간 초과가 발생하지만 문서를 찾을 수있을 때 정상적으로 작동하는 이유는 무엇입니까?