That's it for this module. In this module we first of all had a look at how you can store geospatial
data. You store it next to your other data in your documents,
the special thing about geospatial data is that you use the geo json format and there you need to follow that
exact format of having a type with one of the supported types mongodb, well does support, you can
find that in the official docs and the coordinates which are an array where the first element is the longitude
and the second element is the latitude,
this is how you store use geospatial data.
Now you can also create geospatial indexes,
some operations do require one,
you store them by adding an index of type 2D sphere with create index
and again as I mentioned, the near operation does require such an index, other operations like geoWithin
don't,
still it will probably speed up your queries.
Speaking of queries, we saw three important operators, near, geoWithin and geoIntersects and these
three get you very far because they allow you to find elements that are near you, restrict the radius,
sort them by distance and also do other things like find out if something is in an area and so on.
These geospatial queries also all work with geo json data,
so really make sure you understand that format and you use that format for both the data you store and
the data you then use in your queries.
And that's it with the geospatial data,
a very powerful feature of mongodb that makes working with locations and areas really simple.