我不明白爲什麼我的查詢不適用於MongoDb $ geoNear?
我檢查這個問題沒有成功:mongodb geoNear command with filter
我的環境:
- 的NodeJS:V6.6.0
- 貓鼬:4.8.6
這個作品
db.collection.geoNear(
coords,
{
query : { status: "1" } }, // I have the good filtered results
...
我已經測試
...
query : { _id: { $in: itemIds } }, //no error and empty result
query : { "_id": "5639ce8c01f7d527089d2a74" }, //no error and empty result
query : { "_id" : 'ObjectId("5649e9f35f0b360300cad022")' }, //no error and empty result
query : { "_id" : ObjectId("5649e9f35f0b360300cad022") }, //error ObjectId not defined
...
我想這
db.collection.geoNear(
coords,
{
query : { _id: { $nin: poiIds } }, // no error but I have not the good results because I obtain all results geolocalized
...
謝謝;-)