Complete the code to find documents near a point using $near.
db.places.find({ location: { $near: { $geometry: { type: "Point", coordinates: [1] } } } })The coordinates must be an array of numbers representing longitude and latitude.
Complete the code to find documents within a polygon using $geoWithin.
db.parks.find({ area: { $geoWithin: { $geometry: { type: "Polygon", coordinates: [1] } } } })The coordinates for a polygon must be an array of linear rings, so an array inside an array.
Fix the error in the query to find documents near a point with max distance.
db.stores.find({ location: { $near: { $geometry: { type: "Point", coordinates: [ -73.97, 40.77 ] }, $maxDistance: [1] } } })The $maxDistance value must be a number, not a string or array.
Fill both blanks to find documents within a circle using $geoWithin and $centerSphere.
db.locations.find({ position: { $geoWithin: { $centerSphere: [ [1], [2] ] } } })The first blank is the center point as an array of coordinates. The second blank is the radius in radians.
Fill all three blanks to find documents near a point with min and max distance.
db.places.find({ location: { $near: { $geometry: { type: "Point", coordinates: [1] }, $minDistance: [2], $maxDistance: [3] } } })The coordinates must be longitude then latitude. $minDistance and $maxDistance are numbers in meters.