1
0
Fork 0
arangodb/Documentation/Examples/accessViaGeoIndex.generated

30 lines
745 B
Plaintext

arangosh> for (i = -90; i <= 90; i += 10) {
........> for (j = -180; j <= 180; j += 10) {
........> db.example.save({ name : "Name/" + i + "/" + j,
........> home : [ i, j ],
........> work : [ -i, -j ] });
........> }
........> }
........>
arangosh> db.example.ensureGeoIndex("home");
{
"id" : "example/1118434187",
"type" : "geo1",
"fields" : [
"home"
],
"geoJson" : false,
"constraint" : false,
"unique" : false,
"ignoreNull" : true,
"sparse" : true,
"isNewlyCreated" : true,
"code" : 201
}
arangosh> items = db.example.getIndexes().map(function(x) { return x.id; });
........> db.example.index(items[1]);
[
"example/0",
"example/1118434187"
]