Why aggregate
aggregate.near({
near: coord,
distanceField: "distance",
maxDistance: max
});
can return
{
"name": "MongoError",
"errmsg": "exception: geoNear mand failed: { ok: 0.0, errmsg: \"more than one 2d index, not sure which to run geoNear on\" }",
"code": 16604,
"ok": 0
}
having in the scheme the only 2d index:
location: { type: [ Number ], index: '2d', sparse: true },
more or less when i remove EVERYTHING from the scheme the error doenst change why? o why...
Why aggregate
aggregate.near({
near: coord,
distanceField: "distance",
maxDistance: max
});
can return
{
"name": "MongoError",
"errmsg": "exception: geoNear mand failed: { ok: 0.0, errmsg: \"more than one 2d index, not sure which to run geoNear on\" }",
"code": 16604,
"ok": 0
}
having in the scheme the only 2d index:
location: { type: [ Number ], index: '2d', sparse: true },
more or less when i remove EVERYTHING from the scheme the error doenst change why? o why...
Share Improve this question edited Sep 30, 2014 at 7:20 Nik Terentyev asked Sep 30, 2014 at 7:04 Nik TerentyevNik Terentyev 2,3103 gold badges19 silver badges24 bronze badges1 Answer
Reset to default 8When you remove an index (or even an entire field) in your Mongoose model, it is not automatically removed from MongoDB.
Run db.<your collection name>.getIndexes()
to view all indexes. Make a note of the name
of the index you want to remove.
Run db.<your collection name>.dropIndex(<name of the index>)
to remove an index.
By default, Mongoose tells MongoDB to (re-)create indexes ("ensureIndex()
") when you start your app.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745285057a4620509.html
评论列表(0条)