As seen in the official documentation, structure of the polygon GeoJSON object is as shown below:
db.someCollection.insert({
type: "Polygon",
coordinates: [[[0, 0], [3, 6], [6, 1], [0, 0]]]
});
why is it not as simply as shown below:
Type A
db.someCollection.insert({
type: "Polygon",
coordinates: [[0, 0], [3, 6], [6, 1], [0, 0]]
});
I assume the reason might be to store multiple geofences. Something like this:
Type B
db.someCollection.insert({
type: "Polygon",
coordinates: [
[[0, 0], [3, 6], [6, 1], [0, 0]],
[[1, 1], [3, 6], [6, 1], [1, 1]]
]
});
The reason why I posted this question is because I guess my assumption is wrong after using some of the features in Mongo DB(like $geoIntersects and $geoWithin) which requires the structure to be in Type A format.