1
0
Fork 0
arangodb/Doxygen/Examples.Durham/fluent26

28 lines
718 B
Plaintext

avocado> db.geo.ensureGeoIndex("loc");
162534834
avocado> for (i = -90; i <= 90; i += 10)
.......> for (j = -180; j <= 180; j += 10)
.......> db.geo.save({ name : "Name" + i + "-" + j,
.......> loc: [ i, j ] });
avocado> db.geo.near(0,0).distance();
{ "name" : "0_0",
"loc" : [ 0, 0 ],
"_id" : "144958:24840824", "_distance" : 0 }
{ "name" : "0_10",
"loc" : [ 0, 10 ],
"_id" : "144958:24906360",
"_distance" : 1111949.2664455874 }
.
.
{ "name" : "-20_-10",
"loc" : [ -20, -10 ],
"_id" : "144958:19925624",
"_distance" : 2476171.4106209576 }
{ "name" : "-10_-20",
"loc" : [ -10, -20 ],
"_id" : "144958:22284920",
"_distance" : 2476171.4106209576 }
...more results...