As per my current understanding on MongoDB we search our collection by passing an array of [long, lat] pair arrays, to check if that document's [long, lat] pair exits inside the coordinates [[ [], [], [] ]]
.
i,e.,
db.SomeCollection.find({
"location":{
$geoWithin: {
$geometry: {
type: "Polygon",
coordinates: [
[[1, 2], [1, 3], [1, 4]],
[[2, 5], [2, 6], [2, 7]]
] }
}
}
})
What i am looking for is that i need to feed the [long, lat] pair to a document containing fixed Polygonal Geofence arrays and conclude if the [long, lat] pair exists inside any of those [Polygonal Geofence arrays].
Is this possible in MongoDB? Is my question valid?
Please Note: I am novice to MongoDB as well as Geospatial Data hence
forgive if the question contains wrong terminologies.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…