MongoDB地理索引在生产服务器上不工作
刚转到生产Ubuntu实例,我得到:MongoDB地理索引在生产服务器上不工作,mongodb,ubuntu,Mongodb,Ubuntu,刚转到生产Ubuntu实例,我得到: planner returned error: unable to find index for $geoNear query, name=MongoError, ok=0, errmsg=error processing query: ns=esper.usersTree: $and gender $eq "female" profileSetup $eq true age $lt 25 age $gt 21 $not _id $eq Objec
planner returned error: unable to find index for $geoNear query, name=MongoError, ok=0, errmsg=error processing query: ns=esper.usersTree: $and
gender $eq "female"
profileSetup $eq true
age $lt 25
age $gt 21
$not
_id $eq ObjectId('5b248a699dc80c04b112a289')
GEONEAR field=location maxdist=10000 isNearSphere=0
但是,索引已配置为:
尝试重新启动MongoDB。是否需要运行某种缓存或命令来配置索引?您的查询是什么?同一查询在本地工作您应该将查询发布到您的查询位于不同的命名空间(
esper.users
)上,而不是为getIndexes()
(使用test.users
)提供的输出。如果您更改到同一个数据库(使用esper
),我怀疑您会发现该数据库中没有创建地理索引。--谢谢Stennie post的回答,以便我可以标记为已接受