aggregation framework - MongoDB Sorting on GeoNear Results -
i'm trying sort values in collection "vehicle" text field "condition", although seems sorting having no effect on result set. believe syntax correct, cause of problem?
db.vehicle.aggregate([ { $geonear: { near:[26.243640,-80.265397], maxdistance: 2500/111.12, query: { isactive: true, condition: {$in: ['new','used']} }, distancefield: "distance", limit: 10 } }, { $project: {condition: 1, distance: 1} }, { $sort: {condition: -1} } ])
Comments
Post a Comment