2
나는 meteor를 사용하여 mongodb 컬렉션을 쿼리합니다. 바로 지금이 위치가 2dsphere 인덱스 인 쿼리입니다.MongoDb 위치 배열에있는 배열
messages.find({
location:
{
$geoWithin :{$centerSphere : [ [ longitude, latitude ] , radius ] }
}
});
내가 '위치'2dsphere 인덱스의 배열이었다 내가 배열이 longitude, latitude
쌍 radius
내 요소를 포함입니다 어떤 항목을 원하는 경우이 쿼리에서 변경해야? 당신은 당신이
> db.test.find({
"locs.loc" : {
"$geoWithin" : { "$centerSphere" : [ [ longitude, latitude ] , radius ] }
}
}
처럼이 작품을 원하는 쿼리를 수행 할 수 있습니다
> db.test.ensureIndex({ "locs.loc" : "2dsphere })
를 사용하여 2dsphere 지수를 구성하는 경우와 함께 문서를