我有一个NodeJS服务器Mongodb,Express和Mongoose。我在做一个地理空间查询。我在Mac上本地运行,一切正常。当我将我的整个项目FTP到Ubuntu框中时,我可以运行该项目,但查询失败了:
{ name: 'MongoError',
message: 'error processing query: ns=crime.crimesTree: GEONEAR field=location maxdist=0.000156961 isNearSphere=1\nSort: {}\nProj: {}\n planner returned error: unable to find index for $geoNear query',
waitedMS: 0,
ok: 0,
errmsg: 'error processing query: ns=crime.crimesTree: GEONEAR field=location maxdist=0.000156961 isNearSphere=1\nSort: {}\nProj: {}\n planner returned error: unable to find index for $geoNear query',
code: 2 }
GET /crimeindex?lat=41.8841661&lon=-87.6411432 500 86.505 ms - 453
我应该提到SAVING到数据库按预期工作