Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumMongoDBgeospatial queriesSingle-choice MCQ

A `$geoNear` aggregation stage is failing with an error about requiring an index. What is a unique constraint of `$geoNear` compared to other ways of running geospatial queries?

db.places.aggregate([ { $geoNear: { near: { type: "Point", coordinates: [-73.99, 40.73] }, distanceField: "dist", spherical: true } } ]);