【发布时间】:2017-09-05 05:11:34
【问题描述】:
我不明白为什么我的查询不适用于 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
...
谢谢 ;-)
【问题讨论】:
标签: node.js mongodb mongoose mongodb-query