-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Query 2018-08-13
I have an aggregation to find players have score near someone's score:
db.collection.aggregate([
{
$geoNear: {
limit: 10,
near: [0, 0],
distanceField: "range",
query: {playerId: {$ne: ObjectId("5b3d905d0e79f323249ff14e")}, score: {$gt: 0}, seasonId: ObjectId("5b447af4d4e83558ee3b30d3")}
}
}
]);
I created indexes for playerId field and seasonId field. When I do a normal find query with playerId or seasonId, I use the indexes of them. But when I run the above aggregation query, the option query of "$geoNear" can not use the indexes.
So, please improve this feature, thanks so much.