U moet uw locatiegegevens opslaan zoals dit schema:
{"loc":
{"coordinates":[
[
[1.0,1.0],
[1.0,10.0],
[10.0,10.0],
[10.0,1.0],
[1.0,1.0]
]
],
"type":"Polygon"
}
}
en stuur dan $geoIntersects
vragen
db.polygons.find({"loc":{"$geoIntersects":{"$geometry":{"type":"Point", "coordinates":[x, y]}}}}