1 00:00:02,220 --> 00:00:08,070 That's it for this module. In this module we first of all had a look at how you can store geospatial 2 00:00:08,070 --> 00:00:12,210 data. You store it next to your other data in your documents, 3 00:00:12,210 --> 00:00:18,630 the special thing about geospatial data is that you use the geo json format and there you need to follow that 4 00:00:18,630 --> 00:00:24,900 exact format of having a type with one of the supported types mongodb, well does support, you can 5 00:00:24,900 --> 00:00:30,930 find that in the official docs and the coordinates which are an array where the first element is the longitude 6 00:00:30,970 --> 00:00:33,360 and the second element is the latitude, 7 00:00:33,360 --> 00:00:35,950 this is how you store use geospatial data. 8 00:00:36,360 --> 00:00:39,070 Now you can also create geospatial indexes, 9 00:00:39,180 --> 00:00:41,410 some operations do require one, 10 00:00:41,460 --> 00:00:46,340 you store them by adding an index of type 2D sphere with create index 11 00:00:46,440 --> 00:00:51,900 and again as I mentioned, the near operation does require such an index, other operations like geoWithin 12 00:00:51,930 --> 00:00:52,720 don't, 13 00:00:52,740 --> 00:00:55,700 still it will probably speed up your queries. 14 00:00:55,710 --> 00:01:02,670 Speaking of queries, we saw three important operators, near, geoWithin and geoIntersects and these 15 00:01:02,670 --> 00:01:08,970 three get you very far because they allow you to find elements that are near you, restrict the radius, 16 00:01:09,070 --> 00:01:16,970 sort them by distance and also do other things like find out if something is in an area and so on. 17 00:01:17,310 --> 00:01:21,030 These geospatial queries also all work with geo json data, 18 00:01:21,060 --> 00:01:27,180 so really make sure you understand that format and you use that format for both the data you store and 19 00:01:27,180 --> 00:01:29,500 the data you then use in your queries. 20 00:01:29,730 --> 00:01:31,670 And that's it with the geospatial data, 21 00:01:31,790 --> 00:01:37,790 a very powerful feature of mongodb that makes working with locations and areas really simple.