-
Type:
Question
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.4 Required
-
Component/s: Admin, Aggregation Framework, Index Maintenance
-
None
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
my $geonear function is not returning the expected array of nearest driver in my collection.
i am running these queries to get the result.
to create indexes for geonear i used:
db.dectar_drivers.createIndex({point:"2dsphere"});
to find the nearest driver i have used:
db.dectar_drivers.aggregate([
{
$geoNear: {
near: { type: "Point", coordinates: [ 22.7323132 ,75.8753951] },
distanceField: "total_mileage",
maxDistance: 200,
includeLocs: "loc",
num: 5,
spherical: true
}
}
])