Add filter functionalities by geo data

This commit is contained in:
David Eder
2021-05-18 19:17:59 +02:00
parent df5084bf21
commit dfd53a6623
3 changed files with 30 additions and 9 deletions
+2
View File
@@ -2,3 +2,5 @@
mongoimport --db entities --collection cars --type json --file cars.json --jsonArray
mongoimport --db entities --collection trafficLights --type json --file traffic_lights.json --jsonArray
mongo --eval 'db.trafficLights.ensureIndex({location:"2dsphere"})' entities
@@ -1,16 +1,10 @@
[
{
"id": "1",
"location": {
"type": "Point",
"coordinates": [-73.856077, 40.848447]
}
"location": [16.315283, 48.190331]
},
{
"id": "2",
"location": {
"type": "Point",
"coordinates": [-73.856077, 40.848447]
}
"location": [16.316331, 48.192382]
}
]