I'm new to ArangoDB and NoSQL in general, I'm researching ArangoDB for the spatial queries
I have ran two simple examples correctly https://mikewilliamson.wordpress.com/2014/05/07/arangodbs-geo-spatial-functions/
Now, when I try to apply to my current documents, I just can't seem to make it work
Here is an example of my JSON Doc
{
"branches": [
{
"currentGeoLocation": {
"latitude": -10,
"longitude": 1
}
}
],
"name": "example"
}
I have tried the following queries with no luck
LET coll = (FOR item IN positions
RETURN {
name:item.name,
lat:item.branches[0].currentGeoLocation.latitude,
lng:item.branches[0].currentGeoLocation.longitude
})
FOR geo IN WITHIN(coll, -10, 1, 1) RETURN geo
-----------
FOR item in positions
FOR branch in item.branches
for geo in within(branch,-10,2,1)
return geo
Can anyone help me on how to get the collection of geoLocations correctly in order to get the geo query running please?
Also, I have already defined the geo indexes with mongosh without any errors: db.positions.ensureGeoIndex('latitude','longitude');