mongo $geoIntersects

Get get LineString and Polygin - instead of $geoWithin

const box = req.body.box const leftX = box[0][0] const leftY = box[0][1] const rightX = box[1][0] const rightY = box[1][1] const layer = req.params.layer const facilityService = app.service('facility') let query = { $and: [ { geometry: { $geoIntersects: { $geometry: { type: 'Polygon', coordinates: [ [ [leftX, leftY], [leftX, rightY], [rightX, rightY], [rightX, leftY], [leftX, leftY] ] ] } } } }, { 'properties.layer': { $eq: layer } } ] }
 
 
Howto get any item (Point, LineString, Polygon) within a bounding box in mongodb
I've a problem with a query matching items inside a BoundingBox. How it's possible to match all items of type 2dsphere (GEO JSON)? In this case I only got the data of type Point but the items of t...
Howto get any item (Point, LineString, Polygon) within a bounding box in mongodb

Recommendations