Skip to content

Instantly share code, notes, and snippets.

@dothebart
Created August 3, 2015 13:35
Show Gist options
  • Save dothebart/fdf586deab7c4d6a66be to your computer and use it in GitHub Desktop.
Save dothebart/fdf586deab7c4d6a66be to your computer and use it in GitHub Desktop.
gitbook code problems
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
<title>Geo Indexes | ArangoDB Documentation</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.0.2">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="../IndexHandling/Cap.html" />
<link rel="prev" href="../IndexHandling/Fulltext.html" />
<script type="text/javascript" src="../styles/header.js"></script><link rel="stylesheet" type="text/css" href="../styles/header.css">
</head>
<body>
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.css">
<link rel="stylesheet" href="../styles/website.css">
<div class="book" data-level="27.4.4" data-basepath=".." data-revision="Mon Aug 03 2015 15:09:10 GMT+0200 (CEST)">
<div class="book-summary">
<div class="book-search">
<input type="text" placeholder="Type to search" class="form-control" />
</div>
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../index.html">
<i class="fa fa-check"></i>
Introduction
</a>
</li>
<li class="chapter " data-level="1" data-path="Installing/index.html">
<a href="../Installing/index.html">
<i class="fa fa-check"></i>
<b>1.</b>
Installing
</a>
<ul class="articles">
<li class="chapter " data-level="1.1" data-path="Installing/Linux.html">
<a href="../Installing/Linux.html">
<i class="fa fa-check"></i>
<b>1.1.</b>
Linux
</a>
</li>
<li class="chapter " data-level="1.2" data-path="Installing/MacOSX.html">
<a href="../Installing/MacOSX.html">
<i class="fa fa-check"></i>
<b>1.2.</b>
Mac OS X
</a>
</li>
<li class="chapter " data-level="1.3" data-path="Installing/Windows.html">
<a href="../Installing/Windows.html">
<i class="fa fa-check"></i>
<b>1.3.</b>
Windows
</a>
</li>
<li class="chapter " data-level="1.4" data-path="Installing/Compiling.html">
<a href="../Installing/Compiling.html">
<i class="fa fa-check"></i>
<b>1.4.</b>
Compiling
</a>
</li>
<li class="chapter " data-level="1.5" data-path="Installing/Upgrading.html">
<a href="../Installing/Upgrading.html">
<i class="fa fa-check"></i>
<b>1.5.</b>
Upgrading
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Upgrading/UpgradingChanges26.html">
<a href="../Upgrading/UpgradingChanges26.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Incompatible changes in 2.6
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="Upgrading/Upgrading26.html">
<a href="../Upgrading/Upgrading26.html">
<i class="fa fa-check"></i>
<b>1.5.2.</b>
Upgrading to 2.6
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="Upgrading/UpgradingChanges25.html">
<a href="../Upgrading/UpgradingChanges25.html">
<i class="fa fa-check"></i>
<b>1.5.3.</b>
Incompatible changes in 2.5
</a>
</li>
<li class="chapter " data-level="1.5.4" data-path="Upgrading/Upgrading25.html">
<a href="../Upgrading/Upgrading25.html">
<i class="fa fa-check"></i>
<b>1.5.4.</b>
Upgrading to 2.5
</a>
</li>
<li class="chapter " data-level="1.5.5" data-path="Upgrading/UpgradingChanges24.html">
<a href="../Upgrading/UpgradingChanges24.html">
<i class="fa fa-check"></i>
<b>1.5.5.</b>
Incompatible changes in 2.4
</a>
</li>
<li class="chapter " data-level="1.5.6" data-path="Upgrading/Upgrading24.html">
<a href="../Upgrading/Upgrading24.html">
<i class="fa fa-check"></i>
<b>1.5.6.</b>
Upgrading to 2.4
</a>
</li>
<li class="chapter " data-level="1.5.7" data-path="Upgrading/UpgradingChanges23.html">
<a href="../Upgrading/UpgradingChanges23.html">
<i class="fa fa-check"></i>
<b>1.5.7.</b>
Incompatible changes in 2.3
</a>
</li>
<li class="chapter " data-level="1.5.8" data-path="Upgrading/Upgrading23.html">
<a href="../Upgrading/Upgrading23.html">
<i class="fa fa-check"></i>
<b>1.5.8.</b>
Upgrading to 2.3
</a>
</li>
<li class="chapter " data-level="1.5.9" data-path="Upgrading/Upgrading22.html">
<a href="../Upgrading/Upgrading22.html">
<i class="fa fa-check"></i>
<b>1.5.9.</b>
Upgrading to 2.2
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="Installing/Cluster.html">
<a href="../Installing/Cluster.html">
<i class="fa fa-check"></i>
<b>1.6.</b>
Cluster setup
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="2" data-path="NewFeatures/NewFeatures26.html">
<a href="../NewFeatures/NewFeatures26.html">
<i class="fa fa-check"></i>
<b>2.</b>
Whats New
</a>
<ul class="articles">
<li class="chapter " data-level="2.1" data-path="NewFeatures/NewFeatures25.html">
<a href="../NewFeatures/NewFeatures25.html">
<i class="fa fa-check"></i>
<b>2.1.</b>
Whats New in 2.5
</a>
</li>
<li class="chapter " data-level="2.2" data-path="NewFeatures/NewFeatures24.html">
<a href="../NewFeatures/NewFeatures24.html">
<i class="fa fa-check"></i>
<b>2.2.</b>
Whats New in 2.4
</a>
</li>
<li class="chapter " data-level="2.3" data-path="NewFeatures/NewFeatures23.html">
<a href="../NewFeatures/NewFeatures23.html">
<i class="fa fa-check"></i>
<b>2.3.</b>
Whats New in 2.3
</a>
</li>
<li class="chapter " data-level="2.4" data-path="NewFeatures/NewFeatures22.html">
<a href="../NewFeatures/NewFeatures22.html">
<i class="fa fa-check"></i>
<b>2.4.</b>
Whats New in 2.2
</a>
</li>
<li class="chapter " data-level="2.5" data-path="NewFeatures/NewFeatures21.html">
<a href="../NewFeatures/NewFeatures21.html">
<i class="fa fa-check"></i>
<b>2.5.</b>
Whats New in 2.1
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3" data-path="FirstSteps/index.html">
<a href="../FirstSteps/index.html">
<i class="fa fa-check"></i>
<b>3.</b>
First Steps
</a>
<ul class="articles">
<li class="chapter " data-level="3.1" data-path="FirstSteps/GettingFamiliar.html">
<a href="../FirstSteps/GettingFamiliar.html">
<i class="fa fa-check"></i>
<b>3.1.</b>
Getting Familiar
</a>
</li>
<li class="chapter " data-level="3.2" data-path="FirstSteps/Arangod.html">
<a href="../FirstSteps/Arangod.html">
<i class="fa fa-check"></i>
<b>3.2.</b>
The ArangoDB Server
</a>
</li>
<li class="chapter " data-level="3.3" data-path="Arangosh/index.html">
<a href="../Arangosh/index.html">
<i class="fa fa-check"></i>
<b>3.3.</b>
The ArangoDB Shell
</a>
<ul class="articles">
<li class="chapter " data-level="3.3.1" data-path="Arangosh/Output.html">
<a href="../Arangosh/Output.html">
<i class="fa fa-check"></i>
<b>3.3.1.</b>
Shell Output
</a>
</li>
<li class="chapter " data-level="3.3.2" data-path="Arangosh/Configuration.html">
<a href="../Arangosh/Configuration.html">
<i class="fa fa-check"></i>
<b>3.3.2.</b>
Configuration
</a>
</li>
<li class="chapter " data-level="3.3.3" data-path="FirstSteps/Arangosh.html">
<a href="../FirstSteps/Arangosh.html">
<i class="fa fa-check"></i>
<b>3.3.3.</b>
Details
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.4" data-path="FirstSteps/CollectionsAndDocuments.html">
<a href="../FirstSteps/CollectionsAndDocuments.html">
<i class="fa fa-check"></i>
<b>3.4.</b>
Collections
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="4" data-path="WebInterface/index.html">
<a href="../WebInterface/index.html">
<i class="fa fa-check"></i>
<b>4.</b>
ArangoDB Web Interface
</a>
</li>
<li class="chapter " data-level="5" data-path="Databases/index.html">
<a href="../Databases/index.html">
<i class="fa fa-check"></i>
<b>5.</b>
Creating and Dropping Databases
</a>
<ul class="articles">
<li class="chapter " data-level="5.1" data-path="Databases/WorkingWith.html">
<a href="../Databases/WorkingWith.html">
<i class="fa fa-check"></i>
<b>5.1.</b>
Working with Databases
</a>
</li>
<li class="chapter " data-level="5.2" data-path="Databases/Notes.html">
<a href="../Databases/Notes.html">
<i class="fa fa-check"></i>
<b>5.2.</b>
Notes about Databases
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="6" data-path="Collections/index.html">
<a href="../Collections/index.html">
<i class="fa fa-check"></i>
<b>6.</b>
Creating and Dropping Collections
</a>
<ul class="articles">
<li class="chapter " data-level="6.1" data-path="Collections/CollectionMethods.html">
<a href="../Collections/CollectionMethods.html">
<i class="fa fa-check"></i>
<b>6.1.</b>
Collection Methods
</a>
</li>
<li class="chapter " data-level="6.2" data-path="Collections/DatabaseMethods.html">
<a href="../Collections/DatabaseMethods.html">
<i class="fa fa-check"></i>
<b>6.2.</b>
Database Methods
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="7" data-path="Documents/index.html">
<a href="../Documents/index.html">
<i class="fa fa-check"></i>
<b>7.</b>
Working with Documents
</a>
<ul class="articles">
<li class="chapter " data-level="7.1" data-path="Documents/DocumentAddress.html">
<a href="../Documents/DocumentAddress.html">
<i class="fa fa-check"></i>
<b>7.1.</b>
Address and ETag
</a>
</li>
<li class="chapter " data-level="7.2" data-path="Documents/DocumentMethods.html">
<a href="../Documents/DocumentMethods.html">
<i class="fa fa-check"></i>
<b>7.2.</b>
Collection Methods
</a>
</li>
<li class="chapter " data-level="7.3" data-path="Documents/DatabaseMethods.html">
<a href="../Documents/DatabaseMethods.html">
<i class="fa fa-check"></i>
<b>7.3.</b>
Database Methods
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="8" data-path="Edges/index.html">
<a href="../Edges/index.html">
<i class="fa fa-check"></i>
<b>8.</b>
Working with Edges
</a>
</li>
<li class="chapter " data-level="9" data-path="SimpleQueries/index.html">
<a href="../SimpleQueries/index.html">
<i class="fa fa-check"></i>
<b>9.</b>
Simple Queries
</a>
<ul class="articles">
<li class="chapter " data-level="9.1" data-path="SimpleQueries/GeoQueries.html">
<a href="../SimpleQueries/GeoQueries.html">
<i class="fa fa-check"></i>
<b>9.1.</b>
Geo Queries
</a>
</li>
<li class="chapter " data-level="9.2" data-path="SimpleQueries/FulltextQueries.html">
<a href="../SimpleQueries/FulltextQueries.html">
<i class="fa fa-check"></i>
<b>9.2.</b>
Fulltext Queries
</a>
</li>
<li class="chapter " data-level="9.3" data-path="SimpleQueries/Pagination.html">
<a href="../SimpleQueries/Pagination.html">
<i class="fa fa-check"></i>
<b>9.3.</b>
Pagination
</a>
</li>
<li class="chapter " data-level="9.4" data-path="SimpleQueries/Access.html">
<a href="../SimpleQueries/Access.html">
<i class="fa fa-check"></i>
<b>9.4.</b>
Sequential Access
</a>
</li>
<li class="chapter " data-level="9.5" data-path="SimpleQueries/ModificationQueries.html">
<a href="../SimpleQueries/ModificationQueries.html">
<i class="fa fa-check"></i>
<b>9.5.</b>
Modification Queries
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="10" data-path="Transactions/index.html">
<a href="../Transactions/index.html">
<i class="fa fa-check"></i>
<b>10.</b>
Transactions
</a>
<ul class="articles">
<li class="chapter " data-level="10.1" data-path="Transactions/TransactionInvocation.html">
<a href="../Transactions/TransactionInvocation.html">
<i class="fa fa-check"></i>
<b>10.1.</b>
Transaction invocation
</a>
</li>
<li class="chapter " data-level="10.2" data-path="Transactions/Passing.html">
<a href="../Transactions/Passing.html">
<i class="fa fa-check"></i>
<b>10.2.</b>
Passing parameters
</a>
</li>
<li class="chapter " data-level="10.3" data-path="Transactions/LockingAndIsolation.html">
<a href="../Transactions/LockingAndIsolation.html">
<i class="fa fa-check"></i>
<b>10.3.</b>
Locking and isolation
</a>
</li>
<li class="chapter " data-level="10.4" data-path="Transactions/Durability.html">
<a href="../Transactions/Durability.html">
<i class="fa fa-check"></i>
<b>10.4.</b>
Durability
</a>
</li>
<li class="chapter " data-level="10.5" data-path="Transactions/Limitations.html">
<a href="../Transactions/Limitations.html">
<i class="fa fa-check"></i>
<b>10.5.</b>
Limitations
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="11" data-path="WriteAheadLog/index.html">
<a href="../WriteAheadLog/index.html">
<i class="fa fa-check"></i>
<b>11.</b>
Write-ahead log
</a>
</li>
<li class="chapter " data-level="12" data-path="Aql/index.html">
<a href="../Aql/index.html">
<i class="fa fa-check"></i>
<b>12.</b>
AQL
</a>
<ul class="articles">
<li class="chapter " data-level="12.1" data-path="Aql/Invoke.html">
<a href="../Aql/Invoke.html">
<i class="fa fa-check"></i>
<b>12.1.</b>
How to invoke AQL
</a>
</li>
<li class="chapter " data-level="12.2" data-path="Aql/DataModification.html">
<a href="../Aql/DataModification.html">
<i class="fa fa-check"></i>
<b>12.2.</b>
Data modification queries
</a>
</li>
<li class="chapter " data-level="12.3" data-path="Aql/Optimizer.html">
<a href="../Aql/Optimizer.html">
<i class="fa fa-check"></i>
<b>12.3.</b>
The AQL query optimizer
</a>
</li>
<li class="chapter " data-level="12.4" data-path="Aql/QueryCache.html">
<a href="../Aql/QueryCache.html">
<i class="fa fa-check"></i>
<b>12.4.</b>
The AQL query result cache
</a>
</li>
<li class="chapter " data-level="12.5" data-path="Aql/Basics.html">
<a href="../Aql/Basics.html">
<i class="fa fa-check"></i>
<b>12.5.</b>
Language Basics
</a>
</li>
<li class="chapter " data-level="12.6" data-path="Aql/Functions.html">
<a href="../Aql/Functions.html">
<i class="fa fa-check"></i>
<b>12.6.</b>
Functions
</a>
<ul class="articles">
<li class="chapter " data-level="12.6.1" data-path="Aql/TypeCastFunctions.html">
<a href="../Aql/TypeCastFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.1.</b>
Type cast
</a>
</li>
<li class="chapter " data-level="12.6.2" data-path="Aql/StringFunctions.html">
<a href="../Aql/StringFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.2.</b>
String
</a>
</li>
<li class="chapter " data-level="12.6.3" data-path="Aql/NumericFunctions.html">
<a href="../Aql/NumericFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.3.</b>
Numeric
</a>
</li>
<li class="chapter " data-level="12.6.4" data-path="Aql/DateFunctions.html">
<a href="../Aql/DateFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.4.</b>
Date
</a>
</li>
<li class="chapter " data-level="12.6.5" data-path="Aql/ArrayFunctions.html">
<a href="../Aql/ArrayFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.5.</b>
Array
</a>
</li>
<li class="chapter " data-level="12.6.6" data-path="Aql/DocumentFunctions.html">
<a href="../Aql/DocumentFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.6.</b>
Object / Document
</a>
</li>
<li class="chapter " data-level="12.6.7" data-path="Aql/GeoFunctions.html">
<a href="../Aql/GeoFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.7.</b>
Geo
</a>
</li>
<li class="chapter " data-level="12.6.8" data-path="Aql/FulltextFunctions.html">
<a href="../Aql/FulltextFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.8.</b>
Fulltext
</a>
</li>
<li class="chapter " data-level="12.6.9" data-path="Aql/GraphFunctions.html">
<a href="../Aql/GraphFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.9.</b>
Graph
</a>
</li>
<li class="chapter " data-level="12.6.10" data-path="Aql/MiscellaneousFunctions.html">
<a href="../Aql/MiscellaneousFunctions.html">
<i class="fa fa-check"></i>
<b>12.6.10.</b>
Miscellaneous
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="12.7" data-path="Aql/QueryResults.html">
<a href="../Aql/QueryResults.html">
<i class="fa fa-check"></i>
<b>12.7.</b>
Query Results
</a>
</li>
<li class="chapter " data-level="12.8" data-path="Aql/Operators.html">
<a href="../Aql/Operators.html">
<i class="fa fa-check"></i>
<b>12.8.</b>
Operators
</a>
</li>
<li class="chapter " data-level="12.9" data-path="Aql/Operations.html">
<a href="../Aql/Operations.html">
<i class="fa fa-check"></i>
<b>12.9.</b>
High level Operations
</a>
</li>
<li class="chapter " data-level="12.10" data-path="Aql/GraphOperations.html">
<a href="../Aql/GraphOperations.html">
<i class="fa fa-check"></i>
<b>12.10.</b>
Graph Operations
</a>
</li>
<li class="chapter " data-level="12.11" data-path="Aql/Advanced.html">
<a href="../Aql/Advanced.html">
<i class="fa fa-check"></i>
<b>12.11.</b>
Advanced Features
</a>
</li>
<li class="chapter " data-level="12.12" data-path="AqlExtending/index.html">
<a href="../AqlExtending/index.html">
<i class="fa fa-check"></i>
<b>12.12.</b>
Extending AQL
</a>
<ul class="articles">
<li class="chapter " data-level="12.12.1" data-path="AqlExtending/Conventions.html">
<a href="../AqlExtending/Conventions.html">
<i class="fa fa-check"></i>
<b>12.12.1.</b>
Conventions
</a>
</li>
<li class="chapter " data-level="12.12.2" data-path="AqlExtending/Functions.html">
<a href="../AqlExtending/Functions.html">
<i class="fa fa-check"></i>
<b>12.12.2.</b>
Registering Functions
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="12.13" data-path="AqlExamples/index.html">
<a href="../AqlExamples/index.html">
<i class="fa fa-check"></i>
<b>12.13.</b>
AQL Examples
</a>
<ul class="articles">
<li class="chapter " data-level="12.13.1" data-path="AqlExamples/CollectionQueries.html">
<a href="../AqlExamples/CollectionQueries.html">
<i class="fa fa-check"></i>
<b>12.13.1.</b>
Collection based queries
</a>
</li>
<li class="chapter " data-level="12.13.2" data-path="AqlExamples/DataModificationQueries.html">
<a href="../AqlExamples/DataModificationQueries.html">
<i class="fa fa-check"></i>
<b>12.13.2.</b>
Data-modification queries
</a>
</li>
<li class="chapter " data-level="12.13.3" data-path="AqlExamples/ProjectionsAndFilters.html">
<a href="../AqlExamples/ProjectionsAndFilters.html">
<i class="fa fa-check"></i>
<b>12.13.3.</b>
Projections and filters
</a>
</li>
<li class="chapter " data-level="12.13.4" data-path="AqlExamples/Join.html">
<a href="../AqlExamples/Join.html">
<i class="fa fa-check"></i>
<b>12.13.4.</b>
Joins
</a>
</li>
<li class="chapter " data-level="12.13.5" data-path="AqlExamples/Grouping.html">
<a href="../AqlExamples/Grouping.html">
<i class="fa fa-check"></i>
<b>12.13.5.</b>
Grouping
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="13" data-path="General-Graphs/index.html">
<a href="../General-Graphs/index.html">
<i class="fa fa-check"></i>
<b>13.</b>
General Graphs
</a>
<ul class="articles">
<li class="chapter " data-level="13.1" data-path="General-Graphs/Management.html">
<a href="../General-Graphs/Management.html">
<i class="fa fa-check"></i>
<b>13.1.</b>
Graph Management
</a>
</li>
<li class="chapter " data-level="13.2" data-path="General-Graphs/Functions.html">
<a href="../General-Graphs/Functions.html">
<i class="fa fa-check"></i>
<b>13.2.</b>
Graph Functions
</a>
</li>
<li class="chapter " data-level="13.3" data-path="General-Graphs/FluentAQLInterface.html">
<a href="../General-Graphs/FluentAQLInterface.html">
<i class="fa fa-check"></i>
<b>13.3.</b>
Fluent Query Interface
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="14" data-path="Blueprint-Graphs/index.html">
<a href="../Blueprint-Graphs/index.html">
<i class="fa fa-check"></i>
<b>14.</b>
Blueprint Graphs
</a>
<ul class="articles">
<li class="chapter " data-level="14.1" data-path="Blueprint-Graphs/GraphConstructor.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../Blueprint-Graphs/GraphConstructor.html">
<i class="fa fa-check"></i>
<b>14.1.</b>
Graph Constructor
</a>
</li>
<li class="chapter " data-level="14.2" data-path="Blueprint-Graphs/VertexMethods.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../Blueprint-Graphs/VertexMethods.html">
<i class="fa fa-check"></i>
<b>14.2.</b>
Vertex Methods
</a>
</li>
<li class="chapter " data-level="14.3" data-path="Blueprint-Graphs/EdgeMethods.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../Blueprint-Graphs/EdgeMethods.html">
<i class="fa fa-check"></i>
<b>14.3.</b>
Edge Methods
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="15" data-path="Traversals/index.html">
<a href="../Traversals/index.html">
<i class="fa fa-check"></i>
<b>15.</b>
Traversals
</a>
<ul class="articles">
<li class="chapter " data-level="15.1" data-path="Traversals/UsingTraversalObjects.html">
<a href="../Traversals/UsingTraversalObjects.html">
<i class="fa fa-check"></i>
<b>15.1.</b>
Using Traversal Objects
</a>
</li>
<li class="chapter " data-level="15.2" data-path="Traversals/ExampleData.html">
<a href="../Traversals/ExampleData.html">
<i class="fa fa-check"></i>
<b>15.2.</b>
Example Data
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="16" data-path="Foxx/index.html">
<a href="../Foxx/index.html">
<i class="fa fa-check"></i>
<b>16.</b>
Foxx
</a>
<ul class="articles">
<li class="chapter " data-level="16.1" data-path="Foxx/Nutshell/index.html">
<a href="../Foxx/Nutshell/index.html">
<i class="fa fa-check"></i>
<b>16.1.</b>
In a nutshell
</a>
</li>
<li class="chapter " data-level="16.2" data-path="Foxx/Install/index.html">
<a href="../Foxx/Install/index.html">
<i class="fa fa-check"></i>
<b>16.2.</b>
Install
</a>
<ul class="articles">
<li class="chapter " data-level="16.2.1" data-path="Foxx/Install/Github.html">
<a href="../Foxx/Install/Github.html">
<i class="fa fa-check"></i>
<b>16.2.1.</b>
Github
</a>
</li>
<li class="chapter " data-level="16.2.2" data-path="Foxx/Install/Store.html">
<a href="../Foxx/Install/Store.html">
<i class="fa fa-check"></i>
<b>16.2.2.</b>
Store
</a>
</li>
<li class="chapter " data-level="16.2.3" data-path="Foxx/Install/Local.html">
<a href="../Foxx/Install/Local.html">
<i class="fa fa-check"></i>
<b>16.2.3.</b>
Local
</a>
</li>
<li class="chapter " data-level="16.2.4" data-path="Foxx/Install/Remote.html">
<a href="../Foxx/Install/Remote.html">
<i class="fa fa-check"></i>
<b>16.2.4.</b>
Remote
</a>
</li>
<li class="chapter " data-level="16.2.5" data-path="Foxx/Install/Generate.html">
<a href="../Foxx/Install/Generate.html">
<i class="fa fa-check"></i>
<b>16.2.5.</b>
Generate
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="16.3" data-path="Foxx/Develop/index.html">
<a href="../Foxx/Develop/index.html">
<i class="fa fa-check"></i>
<b>16.3.</b>
Development
</a>
<ul class="articles">
<li class="chapter " data-level="16.3.1" data-path="Foxx/Develop/Developmentmode.html">
<a href="../Foxx/Develop/Developmentmode.html">
<i class="fa fa-check"></i>
<b>16.3.1.</b>
Dev-Mode
</a>
</li>
<li class="chapter " data-level="16.3.2" data-path="Foxx/Develop/Debugging.html">
<a href="../Foxx/Develop/Debugging.html">
<i class="fa fa-check"></i>
<b>16.3.2.</b>
Debugging
</a>
</li>
<li class="chapter " data-level="16.3.3" data-path="Foxx/Develop/Folder.html">
<a href="../Foxx/Develop/Folder.html">
<i class="fa fa-check"></i>
<b>16.3.3.</b>
Source Files
</a>
</li>
<li class="chapter " data-level="16.3.4" data-path="Foxx/Develop/Controller.html">
<a href="../Foxx/Develop/Controller.html">
<i class="fa fa-check"></i>
<b>16.3.4.</b>
Controller
</a>
</li>
<li class="chapter " data-level="16.3.5" data-path="Foxx/Develop/Scripts.html">
<a href="../Foxx/Develop/Scripts.html">
<i class="fa fa-check"></i>
<b>16.3.5.</b>
Scripts
</a>
</li>
<li class="chapter " data-level="16.3.6" data-path="Foxx/Develop/Model.html">
<a href="../Foxx/Develop/Model.html">
<i class="fa fa-check"></i>
<b>16.3.6.</b>
Model
</a>
</li>
<li class="chapter " data-level="16.3.7" data-path="Foxx/Develop/Repository.html">
<a href="../Foxx/Develop/Repository.html">
<i class="fa fa-check"></i>
<b>16.3.7.</b>
Repository
</a>
</li>
<li class="chapter " data-level="16.3.8" data-path="Foxx/Develop/Queries.html">
<a href="../Foxx/Develop/Queries.html">
<i class="fa fa-check"></i>
<b>16.3.8.</b>
Queries
</a>
</li>
<li class="chapter " data-level="16.3.9" data-path="Foxx/Develop/Sessions.html">
<a href="../Foxx/Develop/Sessions.html">
<i class="fa fa-check"></i>
<b>16.3.9.</b>
Sessions
</a>
</li>
<li class="chapter " data-level="16.3.10" data-path="Foxx/Develop/Queues.html">
<a href="../Foxx/Develop/Queues.html">
<i class="fa fa-check"></i>
<b>16.3.10.</b>
Background Tasks
</a>
</li>
<li class="chapter " data-level="16.3.11" data-path="Foxx/Develop/Console.html">
<a href="../Foxx/Develop/Console.html">
<i class="fa fa-check"></i>
<b>16.3.11.</b>
Console API
</a>
</li>
<li class="chapter " data-level="16.3.12" data-path="Foxx/Develop/Manifest.html">
<a href="../Foxx/Develop/Manifest.html">
<i class="fa fa-check"></i>
<b>16.3.12.</b>
Metainformation
</a>
</li>
<li class="chapter " data-level="16.3.13" data-path="Foxx/Develop/ApiDocumentation.html">
<a href="../Foxx/Develop/ApiDocumentation.html">
<i class="fa fa-check"></i>
<b>16.3.13.</b>
Documentation
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="16.4" data-path="Foxx/Production/index.html">
<a href="../Foxx/Production/index.html">
<i class="fa fa-check"></i>
<b>16.4.</b>
Production
</a>
<ul class="articles">
<li class="chapter " data-level="16.4.1" data-path="Foxx/Production/Productionmode.html">
<a href="../Foxx/Production/Productionmode.html">
<i class="fa fa-check"></i>
<b>16.4.1.</b>
Prod-Mode
</a>
</li>
<li class="chapter " data-level="16.4.2" data-path="Foxx/Production/Debugging.html">
<a href="../Foxx/Production/Debugging.html">
<i class="fa fa-check"></i>
<b>16.4.2.</b>
Debugging
</a>
</li>
<li class="chapter " data-level="16.4.3" data-path="Foxx/Production/Upgrade.html">
<a href="../Foxx/Production/Upgrade.html">
<i class="fa fa-check"></i>
<b>16.4.3.</b>
New Versions
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="16.5" data-path="Foxx/Cluster/index.html">
<a href="../Foxx/Cluster/index.html">
<i class="fa fa-check"></i>
<b>16.5.</b>
Cluster
</a>
<ul class="articles">
<li class="chapter " data-level="16.5.1" data-path="Foxx/Cluster/Install.html">
<a href="../Foxx/Cluster/Install.html">
<i class="fa fa-check"></i>
<b>16.5.1.</b>
Install
</a>
</li>
<li class="chapter " data-level="16.5.2" data-path="Foxx/Cluster/Scripts.html">
<a href="../Foxx/Cluster/Scripts.html">
<i class="fa fa-check"></i>
<b>16.5.2.</b>
Setup &amp; Teardown
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="16.6" data-path="Foxx/Advanced/index.html">
<a href="../Foxx/Advanced/index.html">
<i class="fa fa-check"></i>
<b>16.6.</b>
Advanced Features
</a>
<ul class="articles">
<li class="chapter " data-level="16.6.1" data-path="Foxx/Advanced/Exports.html">
<a href="../Foxx/Advanced/Exports.html">
<i class="fa fa-check"></i>
<b>16.6.1.</b>
Exports
</a>
</li>
<li class="chapter " data-level="16.6.2" data-path="Foxx/Advanced/Injection.html">
<a href="../Foxx/Advanced/Injection.html">
<i class="fa fa-check"></i>
<b>16.6.2.</b>
Dependency Injection
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="17" data-path="ArangoActions/index.html">
<a href="../ArangoActions/index.html">
<i class="fa fa-check"></i>
<b>17.</b>
ArangoDB&#39;s Actions
</a>
<ul class="articles">
<li class="chapter " data-level="17.1" data-path="ArangoActions/HtmlExample.html">
<a href="../ArangoActions/HtmlExample.html">
<i class="fa fa-check"></i>
<b>17.1.</b>
Delivering HTML Pages
</a>
</li>
<li class="chapter " data-level="17.2" data-path="ArangoActions/JsonExample.html">
<a href="../ArangoActions/JsonExample.html">
<i class="fa fa-check"></i>
<b>17.2.</b>
Json Objects
</a>
</li>
<li class="chapter " data-level="17.3" data-path="ArangoActions/Modifying.html">
<a href="../ArangoActions/Modifying.html">
<i class="fa fa-check"></i>
<b>17.3.</b>
Modifying
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="18" data-path="Replication/index.html">
<a href="../Replication/index.html">
<i class="fa fa-check"></i>
<b>18.</b>
Replication
</a>
<ul class="articles">
<li class="chapter " data-level="18.1" data-path="Replication/Components.html">
<a href="../Replication/Components.html">
<i class="fa fa-check"></i>
<b>18.1.</b>
Components
</a>
</li>
<li class="chapter " data-level="18.2" data-path="Replication/ExampleSetup.html">
<a href="../Replication/ExampleSetup.html">
<i class="fa fa-check"></i>
<b>18.2.</b>
Example Setup
</a>
</li>
<li class="chapter " data-level="18.3" data-path="Replication/Limitations.html">
<a href="../Replication/Limitations.html">
<i class="fa fa-check"></i>
<b>18.3.</b>
Replication Limitations
</a>
</li>
<li class="chapter " data-level="18.4" data-path="Replication/Overhead.html">
<a href="../Replication/Overhead.html">
<i class="fa fa-check"></i>
<b>18.4.</b>
Replication Overhead
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="19" data-path="Sharding/index.html">
<a href="../Sharding/index.html">
<i class="fa fa-check"></i>
<b>19.</b>
Sharding
</a>
<ul class="articles">
<li class="chapter " data-level="19.1" data-path="Sharding/HowTo.html">
<a href="../Sharding/HowTo.html">
<i class="fa fa-check"></i>
<b>19.1.</b>
How to try it out
</a>
</li>
<li class="chapter " data-level="19.2" data-path="Sharding/StatusOfImplementation.html">
<a href="../Sharding/StatusOfImplementation.html">
<i class="fa fa-check"></i>
<b>19.2.</b>
Implementation
</a>
</li>
<li class="chapter " data-level="19.3" data-path="Sharding/Authentication.html">
<a href="../Sharding/Authentication.html">
<i class="fa fa-check"></i>
<b>19.3.</b>
Authentication
</a>
</li>
<li class="chapter " data-level="19.4" data-path="Sharding/FirewallSetup.html">
<a href="../Sharding/FirewallSetup.html">
<i class="fa fa-check"></i>
<b>19.4.</b>
Firewall setup
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="20" data-path="ConfigureArango/index.html">
<a href="../ConfigureArango/index.html">
<i class="fa fa-check"></i>
<b>20.</b>
Server Configuration
</a>
<ul class="articles">
<li class="chapter " data-level="20.1" data-path="ConfigureArango/Arangod.html">
<a href="../ConfigureArango/Arangod.html">
<i class="fa fa-check"></i>
<b>20.1.</b>
Arangod options
</a>
</li>
<li class="chapter " data-level="20.2" data-path="ConfigureArango/Wal.html">
<a href="../ConfigureArango/Wal.html">
<i class="fa fa-check"></i>
<b>20.2.</b>
Write-ahead log options
</a>
</li>
<li class="chapter " data-level="20.3" data-path="ConfigureArango/Endpoint.html">
<a href="../ConfigureArango/Endpoint.html">
<i class="fa fa-check"></i>
<b>20.3.</b>
Managing Endpoints
</a>
</li>
<li class="chapter " data-level="20.4" data-path="ConfigureArango/Cluster.html">
<a href="../ConfigureArango/Cluster.html">
<i class="fa fa-check"></i>
<b>20.4.</b>
Cluster options
</a>
</li>
<li class="chapter " data-level="20.5" data-path="ConfigureArango/Logging.html">
<a href="../ConfigureArango/Logging.html">
<i class="fa fa-check"></i>
<b>20.5.</b>
Logging options
</a>
</li>
<li class="chapter " data-level="20.6" data-path="ConfigureArango/Communication.html">
<a href="../ConfigureArango/Communication.html">
<i class="fa fa-check"></i>
<b>20.6.</b>
Communication options
</a>
</li>
<li class="chapter " data-level="20.7" data-path="ConfigureArango/Authentication.html">
<a href="../ConfigureArango/Authentication.html">
<i class="fa fa-check"></i>
<b>20.7.</b>
Authentication
</a>
</li>
<li class="chapter " data-level="20.8" data-path="ConfigureArango/EmergencyConsole.html">
<a href="../ConfigureArango/EmergencyConsole.html">
<i class="fa fa-check"></i>
<b>20.8.</b>
Emergency Console
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="21" data-path="Arangoimp/index.html">
<a href="../Arangoimp/index.html">
<i class="fa fa-check"></i>
<b>21.</b>
Arangoimp
</a>
</li>
<li class="chapter " data-level="22" data-path="Arangodump/index.html">
<a href="../Arangodump/index.html">
<i class="fa fa-check"></i>
<b>22.</b>
Arangodump
</a>
</li>
<li class="chapter " data-level="23" data-path="Arangorestore/index.html">
<a href="../Arangorestore/index.html">
<i class="fa fa-check"></i>
<b>23.</b>
Arangorestore
</a>
</li>
<li class="chapter " data-level="24" data-path="HttpApi/index.html">
<a href="../HttpApi/index.html">
<i class="fa fa-check"></i>
<b>24.</b>
HTTP API
</a>
<ul class="articles">
<li class="chapter " data-level="24.1" data-path="HttpDatabase/index.html">
<a href="../HttpDatabase/index.html">
<i class="fa fa-check"></i>
<b>24.1.</b>
Databases
</a>
<ul class="articles">
<li class="chapter " data-level="24.1.1" data-path="HttpDatabase/DatabaseEndpoint.html">
<a href="../HttpDatabase/DatabaseEndpoint.html">
<i class="fa fa-check"></i>
<b>24.1.1.</b>
To-Endpoint
</a>
</li>
<li class="chapter " data-level="24.1.2" data-path="HttpDatabase/DatabaseManagement.html">
<a href="../HttpDatabase/DatabaseManagement.html">
<i class="fa fa-check"></i>
<b>24.1.2.</b>
Management
</a>
</li>
<li class="chapter " data-level="24.1.3" data-path="HttpDatabase/NotesOnDatabases.html">
<a href="../HttpDatabase/NotesOnDatabases.html">
<i class="fa fa-check"></i>
<b>24.1.3.</b>
Notes on Databases
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.2" data-path="HttpDocument/index.html">
<a href="../HttpDocument/index.html">
<i class="fa fa-check"></i>
<b>24.2.</b>
Documents
</a>
<ul class="articles">
<li class="chapter " data-level="24.2.1" data-path="HttpDocument/AddressAndEtag.html">
<a href="../HttpDocument/AddressAndEtag.html">
<i class="fa fa-check"></i>
<b>24.2.1.</b>
Address and ETag
</a>
</li>
<li class="chapter " data-level="24.2.2" data-path="HttpDocument/WorkingWithDocuments.html">
<a href="../HttpDocument/WorkingWithDocuments.html">
<i class="fa fa-check"></i>
<b>24.2.2.</b>
Working with
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.3" data-path="HttpEdge/index.html">
<a href="../HttpEdge/index.html">
<i class="fa fa-check"></i>
<b>24.3.</b>
Edges
</a>
<ul class="articles">
<li class="chapter " data-level="24.3.1" data-path="HttpEdge/AddressAndEtag.html">
<a href="../HttpEdge/AddressAndEtag.html">
<i class="fa fa-check"></i>
<b>24.3.1.</b>
Address and ETag
</a>
</li>
<li class="chapter " data-level="24.3.2" data-path="HttpEdge/WorkingWithEdges.html">
<a href="../HttpEdge/WorkingWithEdges.html">
<i class="fa fa-check"></i>
<b>24.3.2.</b>
Working with Edges
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.4" data-path="HttpExport/index.html">
<a href="../HttpExport/index.html">
<i class="fa fa-check"></i>
<b>24.4.</b>
Exporting data
</a>
</li>
<li class="chapter " data-level="24.5" data-path="HttpAqlQueryCursor/index.html">
<a href="../HttpAqlQueryCursor/index.html">
<i class="fa fa-check"></i>
<b>24.5.</b>
AQL Query Cursors
</a>
<ul class="articles">
<li class="chapter " data-level="24.5.1" data-path="HttpAqlQueryCursor/QueryResults.html">
<a href="../HttpAqlQueryCursor/QueryResults.html">
<i class="fa fa-check"></i>
<b>24.5.1.</b>
Query Results
</a>
</li>
<li class="chapter " data-level="24.5.2" data-path="HttpAqlQueryCursor/AccessingCursors.html">
<a href="../HttpAqlQueryCursor/AccessingCursors.html">
<i class="fa fa-check"></i>
<b>24.5.2.</b>
Accessing Cursors
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.6" data-path="HttpAqlQuery/index.html">
<a href="../HttpAqlQuery/index.html">
<i class="fa fa-check"></i>
<b>24.6.</b>
AQL Queries
</a>
</li>
<li class="chapter " data-level="24.7" data-path="HttpAqlQueryCache/index.html">
<a href="../HttpAqlQueryCache/index.html">
<i class="fa fa-check"></i>
<b>24.7.</b>
AQL Query Cache
</a>
</li>
<li class="chapter " data-level="24.8" data-path="HttpAqlUserFunctions/index.html">
<a href="../HttpAqlUserFunctions/index.html">
<i class="fa fa-check"></i>
<b>24.8.</b>
AQL User Functions Management
</a>
</li>
<li class="chapter " data-level="24.9" data-path="HttpSimpleQuery/index.html">
<a href="../HttpSimpleQuery/index.html">
<i class="fa fa-check"></i>
<b>24.9.</b>
Simple Queries
</a>
</li>
<li class="chapter " data-level="24.10" data-path="HttpCollection/index.html">
<a href="../HttpCollection/index.html">
<i class="fa fa-check"></i>
<b>24.10.</b>
Collections
</a>
<ul class="articles">
<li class="chapter " data-level="24.10.1" data-path="HttpCollection/Creating.html">
<a href="../HttpCollection/Creating.html">
<i class="fa fa-check"></i>
<b>24.10.1.</b>
Creating
</a>
</li>
<li class="chapter " data-level="24.10.2" data-path="HttpCollection/Getting.html">
<a href="../HttpCollection/Getting.html">
<i class="fa fa-check"></i>
<b>24.10.2.</b>
Getting Information
</a>
</li>
<li class="chapter " data-level="24.10.3" data-path="HttpCollection/Modifying.html">
<a href="../HttpCollection/Modifying.html">
<i class="fa fa-check"></i>
<b>24.10.3.</b>
Modifying
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.11" data-path="HttpIndexes/index.html">
<a href="../HttpIndexes/index.html">
<i class="fa fa-check"></i>
<b>24.11.</b>
Indexes
</a>
<ul class="articles">
<li class="chapter " data-level="24.11.1" data-path="HttpIndexes/WorkingWith.html">
<a href="../HttpIndexes/WorkingWith.html">
<i class="fa fa-check"></i>
<b>24.11.1.</b>
Working with Indexes
</a>
</li>
<li class="chapter " data-level="24.11.2" data-path="HttpIndexes/Cap.html">
<a href="../HttpIndexes/Cap.html">
<i class="fa fa-check"></i>
<b>24.11.2.</b>
Cap Constraints
</a>
</li>
<li class="chapter " data-level="24.11.3" data-path="HttpIndexes/Hash.html">
<a href="../HttpIndexes/Hash.html">
<i class="fa fa-check"></i>
<b>24.11.3.</b>
Hash
</a>
</li>
<li class="chapter " data-level="24.11.4" data-path="HttpIndexes/Skiplist.html">
<a href="../HttpIndexes/Skiplist.html">
<i class="fa fa-check"></i>
<b>24.11.4.</b>
Skiplist
</a>
</li>
<li class="chapter " data-level="24.11.5" data-path="HttpIndexes/Geo.html">
<a href="../HttpIndexes/Geo.html">
<i class="fa fa-check"></i>
<b>24.11.5.</b>
Geo
</a>
</li>
<li class="chapter " data-level="24.11.6" data-path="HttpIndexes/Fulltext.html">
<a href="../HttpIndexes/Fulltext.html">
<i class="fa fa-check"></i>
<b>24.11.6.</b>
Fulltext
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.12" data-path="HttpTransaction/index.html">
<a href="../HttpTransaction/index.html">
<i class="fa fa-check"></i>
<b>24.12.</b>
Transactions
</a>
</li>
<li class="chapter " data-level="24.13" data-path="HttpGharial/index.html">
<a href="../HttpGharial/index.html">
<i class="fa fa-check"></i>
<b>24.13.</b>
General Graph
</a>
<ul class="articles">
<li class="chapter " data-level="24.13.1" data-path="HttpGharial/Management.html">
<a href="../HttpGharial/Management.html">
<i class="fa fa-check"></i>
<b>24.13.1.</b>
Management
</a>
</li>
<li class="chapter " data-level="24.13.2" data-path="HttpGharial/Vertices.html">
<a href="../HttpGharial/Vertices.html">
<i class="fa fa-check"></i>
<b>24.13.2.</b>
Vertices
</a>
</li>
<li class="chapter " data-level="24.13.3" data-path="HttpGharial/Edges.html">
<a href="../HttpGharial/Edges.html">
<i class="fa fa-check"></i>
<b>24.13.3.</b>
Edges
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.14" data-path="HttpGraphs/index.html">
<a href="../HttpGraphs/index.html">
<i class="fa fa-check"></i>
<b>24.14.</b>
Graphs
</a>
<ul class="articles">
<li class="chapter " data-level="24.14.1" data-path="HttpGraphs/Vertex.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../HttpGraphs/Vertex.html">
<i class="fa fa-check"></i>
<b>24.14.1.</b>
Vertex
</a>
</li>
<li class="chapter " data-level="24.14.2" data-path="HttpGraphs/Edge.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../HttpGraphs/Edge.html">
<i class="fa fa-check"></i>
<b>24.14.2.</b>
Edges
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.15" data-path="HttpTraversal/index.html">
<a href="../HttpTraversal/index.html">
<i class="fa fa-check"></i>
<b>24.15.</b>
Traversals
</a>
</li>
<li class="chapter " data-level="24.16" data-path="HttpReplications/index.html">
<a href="../HttpReplications/index.html">
<i class="fa fa-check"></i>
<b>24.16.</b>
Replication
</a>
<ul class="articles">
<li class="chapter " data-level="24.16.1" data-path="HttpReplications/ReplicationDump.html">
<a href="../HttpReplications/ReplicationDump.html">
<i class="fa fa-check"></i>
<b>24.16.1.</b>
Replication Dump
</a>
</li>
<li class="chapter " data-level="24.16.2" data-path="HttpReplications/ReplicationLogger.html">
<a href="../HttpReplications/ReplicationLogger.html">
<i class="fa fa-check"></i>
<b>24.16.2.</b>
Replication Logger
</a>
</li>
<li class="chapter " data-level="24.16.3" data-path="HttpReplications/ReplicationApplier.html">
<a href="../HttpReplications/ReplicationApplier.html">
<i class="fa fa-check"></i>
<b>24.16.3.</b>
Replication Applier
</a>
</li>
<li class="chapter " data-level="24.16.4" data-path="HttpReplications/OtherReplication.html">
<a href="../HttpReplications/OtherReplication.html">
<i class="fa fa-check"></i>
<b>24.16.4.</b>
Other Replication Commands
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.17" data-path="HttpBulkImports/index.html">
<a href="../HttpBulkImports/index.html">
<i class="fa fa-check"></i>
<b>24.17.</b>
Bulk Imports
</a>
<ul class="articles">
<li class="chapter " data-level="24.17.1" data-path="HttpBulkImports/ImportingSelfContained.html">
<a href="../HttpBulkImports/ImportingSelfContained.html">
<i class="fa fa-check"></i>
<b>24.17.1.</b>
JSON Documents
</a>
</li>
<li class="chapter " data-level="24.17.2" data-path="HttpBulkImports/ImportingHeadersAndValues.html">
<a href="../HttpBulkImports/ImportingHeadersAndValues.html">
<i class="fa fa-check"></i>
<b>24.17.2.</b>
Headers and Values
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="24.18" data-path="HttpBatchRequest/index.html">
<a href="../HttpBatchRequest/index.html">
<i class="fa fa-check"></i>
<b>24.18.</b>
Batch Requests
</a>
</li>
<li class="chapter " data-level="24.19" data-path="HttpTasks/index.html">
<a href="../HttpTasks/index.html">
<i class="fa fa-check"></i>
<b>24.19.</b>
Tasks
</a>
</li>
<li class="chapter " data-level="24.20" data-path="HttpAdministrationAndMonitoring/index.html">
<a href="../HttpAdministrationAndMonitoring/index.html">
<i class="fa fa-check"></i>
<b>24.20.</b>
Monitoring
</a>
</li>
<li class="chapter " data-level="24.21" data-path="HttpUserManagement/index.html">
<a href="../HttpUserManagement/index.html">
<i class="fa fa-check"></i>
<b>24.21.</b>
User Management
</a>
</li>
<li class="chapter " data-level="24.22" data-path="HttpAsyncResultsManagement/index.html">
<a href="../HttpAsyncResultsManagement/index.html">
<i class="fa fa-check"></i>
<b>24.22.</b>
Async Result
</a>
</li>
<li class="chapter " data-level="24.23" data-path="HttpEndpoints/index.html">
<a href="../HttpEndpoints/index.html">
<i class="fa fa-check"></i>
<b>24.23.</b>
Endpoints
</a>
</li>
<li class="chapter " data-level="24.24" data-path="HttpShardingInterface/index.html">
<a href="../HttpShardingInterface/index.html">
<i class="fa fa-check"></i>
<b>24.24.</b>
Sharding
</a>
</li>
<li class="chapter " data-level="24.25" data-path="HttpMiscellaneousFunctions/index.html">
<a href="../HttpMiscellaneousFunctions/index.html">
<i class="fa fa-check"></i>
<b>24.25.</b>
Miscellaneous functions
</a>
</li>
<li class="chapter " data-level="24.26" data-path="GeneralHttp/index.html">
<a href="../GeneralHttp/index.html">
<i class="fa fa-check"></i>
<b>24.26.</b>
General Handling
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="25" data-path="ModuleJavaScript/index.html">
<a href="../ModuleJavaScript/index.html">
<i class="fa fa-check"></i>
<b>25.</b>
Javascript Modules
</a>
<ul class="articles">
<li class="chapter " data-level="25.1" data-path="ModuleConsole/index.html">
<a href="../ModuleConsole/index.html">
<i class="fa fa-check"></i>
<b>25.1.</b>
&quot;console&quot;
</a>
</li>
<li class="chapter " data-level="25.2" data-path="ModuleFs/index.html">
<a href="../ModuleFs/index.html">
<i class="fa fa-check"></i>
<b>25.2.</b>
&quot;fs&quot;
</a>
</li>
<li class="chapter " data-level="25.3" data-path="ModuleProcess/index.html">
<a href="../ModuleProcess/index.html">
<i class="fa fa-check"></i>
<b>25.3.</b>
&quot;process&quot;
</a>
</li>
<li class="chapter " data-level="25.4" data-path="ModuleGraph/index.html">
<a href="../ModuleGraph/index.html">
<i class="fa fa-check"></i>
<b>25.4.</b>
&quot;graph&quot;
</a>
<ul class="articles">
<li class="chapter " data-level="25.4.1" data-path="ModuleGraph/GraphConstructor.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../ModuleGraph/GraphConstructor.html">
<i class="fa fa-check"></i>
<b>25.4.1.</b>
Graph Constructors
</a>
</li>
<li class="chapter " data-level="25.4.2" data-path="ModuleGraph/VertexMethods.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../ModuleGraph/VertexMethods.html">
<i class="fa fa-check"></i>
<b>25.4.2.</b>
Vertex Methods
</a>
</li>
<li class="chapter " data-level="25.4.3" data-path="ModuleGraph/EdgeMethods.html">
<a class="fa fa-exclamation-triangle" style="color:rgba(240,210,0,1)" href="../ModuleGraph/EdgeMethods.html">
<i class="fa fa-check"></i>
<b>25.4.3.</b>
Edge Methods
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="25.5" data-path="ModuleRequest/index.html">
<a href="../ModuleRequest/index.html">
<i class="fa fa-check"></i>
<b>25.5.</b>
&quot;request&quot;
</a>
</li>
<li class="chapter " data-level="25.6" data-path="ModuleActions/index.html">
<a href="../ModuleActions/index.html">
<i class="fa fa-check"></i>
<b>25.6.</b>
&quot;actions&quot;
</a>
</li>
<li class="chapter " data-level="25.7" data-path="ModuleQueries/index.html">
<a href="../ModuleQueries/index.html">
<i class="fa fa-check"></i>
<b>25.7.</b>
&quot;queries&quot;
</a>
</li>
<li class="chapter " data-level="25.8" data-path="ModulePlanner/index.html">
<a href="../ModulePlanner/index.html">
<i class="fa fa-check"></i>
<b>25.8.</b>
&quot;planner&quot;
</a>
</li>
<li class="chapter " data-level="25.9" data-path="ModuleWal/index.html">
<a href="../ModuleWal/index.html">
<i class="fa fa-check"></i>
<b>25.9.</b>
Write-ahead log
</a>
</li>
<li class="chapter " data-level="25.10" data-path="ModuleTasks/index.html">
<a href="../ModuleTasks/index.html">
<i class="fa fa-check"></i>
<b>25.10.</b>
Task Management
</a>
</li>
<li class="chapter " data-level="25.11" data-path="UsingJsUnity/index.html">
<a href="../UsingJsUnity/index.html">
<i class="fa fa-check"></i>
<b>25.11.</b>
Using jsUnity
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="26" data-path="AdministratingArango/index.html">
<a href="../AdministratingArango/index.html">
<i class="fa fa-check"></i>
<b>26.</b>
Administrating ArangoDB
</a>
</li>
<li class="chapter " data-level="27" data-path="IndexHandling/index.html">
<a href="../IndexHandling/index.html">
<i class="fa fa-check"></i>
<b>27.</b>
Indexing
</a>
<ul class="articles">
<li class="chapter " data-level="27.1" data-path="IndexHandling/IndexBasics.html">
<a href="../IndexHandling/IndexBasics.html">
<i class="fa fa-check"></i>
<b>27.1.</b>
Index Basics
</a>
</li>
<li class="chapter " data-level="27.2" data-path="IndexHandling/WhichIndex.html">
<a href="../IndexHandling/WhichIndex.html">
<i class="fa fa-check"></i>
<b>27.2.</b>
Which Index to use when
</a>
</li>
<li class="chapter " data-level="27.3" data-path="IndexHandling/HowArangoDBUsesIndexes.html">
<a href="../IndexHandling/HowArangoDBUsesIndexes.html">
<i class="fa fa-check"></i>
<b>27.3.</b>
How ArangoDB uses indexes
</a>
</li>
<li class="chapter " data-level="27.4" data-path="IndexHandling/WorkingWithIndexes.html">
<a href="../IndexHandling/WorkingWithIndexes.html">
<i class="fa fa-check"></i>
<b>27.4.</b>
Working with Indexes
</a>
<ul class="articles">
<li class="chapter " data-level="27.4.1" data-path="IndexHandling/Hash.html">
<a href="../IndexHandling/Hash.html">
<i class="fa fa-check"></i>
<b>27.4.1.</b>
Hash Indexes
</a>
</li>
<li class="chapter " data-level="27.4.2" data-path="IndexHandling/Skiplist.html">
<a href="../IndexHandling/Skiplist.html">
<i class="fa fa-check"></i>
<b>27.4.2.</b>
Skiplists
</a>
</li>
<li class="chapter " data-level="27.4.3" data-path="IndexHandling/Fulltext.html">
<a href="../IndexHandling/Fulltext.html">
<i class="fa fa-check"></i>
<b>27.4.3.</b>
Fulltext Indexes
</a>
</li>
<li class="chapter active" data-level="27.4.4" data-path="IndexHandling/Geo.html">
<a href="../IndexHandling/Geo.html">
<i class="fa fa-check"></i>
<b>27.4.4.</b>
Geo Indexes
</a>
</li>
<li class="chapter " data-level="27.4.5" data-path="IndexHandling/Cap.html">
<a href="../IndexHandling/Cap.html">
<i class="fa fa-check"></i>
<b>27.4.5.</b>
Cap Constraint
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="28" data-path="DatafileDebugger/index.html">
<a href="../DatafileDebugger/index.html">
<i class="fa fa-check"></i>
<b>28.</b>
Datafile Debugger
</a>
</li>
<li class="chapter " data-level="29" data-path="NamingConventions/index.html">
<a href="../NamingConventions/index.html">
<i class="fa fa-check"></i>
<b>29.</b>
Naming Conventions
</a>
<ul class="articles">
<li class="chapter " data-level="29.1" data-path="NamingConventions/DatabaseNames.html">
<a href="../NamingConventions/DatabaseNames.html">
<i class="fa fa-check"></i>
<b>29.1.</b>
Database Names
</a>
</li>
<li class="chapter " data-level="29.2" data-path="NamingConventions/CollectionNames.html">
<a href="../NamingConventions/CollectionNames.html">
<i class="fa fa-check"></i>
<b>29.2.</b>
Collection Names
</a>
</li>
<li class="chapter " data-level="29.3" data-path="NamingConventions/DocumentKeys.html">
<a href="../NamingConventions/DocumentKeys.html">
<i class="fa fa-check"></i>
<b>29.3.</b>
Document Keys
</a>
</li>
<li class="chapter " data-level="29.4" data-path="NamingConventions/AttributeNames.html">
<a href="../NamingConventions/AttributeNames.html">
<i class="fa fa-check"></i>
<b>29.4.</b>
Attribute Names
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="30" data-path="ErrorCodes/index.html">
<a href="../ErrorCodes/index.html">
<i class="fa fa-check"></i>
<b>30.</b>
Error codes and meanings
</a>
</li>
<li class="chapter " data-level="31" data-path="Glossary/index.html">
<a href="../Glossary/index.html">
<i class="fa fa-check"></i>
<b>31.</b>
Glossary
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header">
<!-- Actions Left -->
<a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
<a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
<div id="font-settings-wrapper" class="dropdown pull-left">
<a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
</a>
<div class="dropdown-menu font-settings">
<div class="dropdown-caret">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</div>
<div class="buttons">
<button type="button" id="reduce-font-size" class="button size-2">A</button>
<button type="button" id="enlarge-font-size" class="button size-2">A</button>
</div>
<div class="buttons font-family-list">
<button type="button" data-font="0" class="button">Serif</button>
<button type="button" data-font="1" class="button">Sans</button>
</div>
<div class="buttons color-theme-list">
<button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
<button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
<button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
</div>
</div>
</div>
<!-- Actions Right -->
<div class="dropdown pull-right">
<a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
</a>
<div class="dropdown-menu font-settings dropdown-left">
<div class="dropdown-caret">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</div>
<div class="buttons">
<button type="button" data-sharing="twitter" class="button">
Share on Twitter
</button>
<button type="button" data-sharing="google-plus" class="button">
Share on Google
</button>
<button type="button" data-sharing="facebook" class="button">
Share on Facebook
</button>
<button type="button" data-sharing="weibo" class="button">
Share on Weibo
</button>
<button type="button" data-sharing="instapaper" class="button">
Share on Instapaper
</button>
</div>
</div>
</div>
<a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
<a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
<a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../" >ArangoDB Documentation</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1">
<div class="page-inner">
<section class="normal" id="section-">
<p><a name="geo_indexes"></a></p>
<h1 id="geo-indexes">Geo Indexes</h1>
<p><a name="introduction_to_geo_indexes"></a></p>
<h3 id="introduction-to-geo-indexes">Introduction to Geo Indexes</h3>
<p>This is an introduction to ArangoDB&apos;s geo indexes.</p>
<p>ArangoDB uses Hilbert curves to implement geo-spatial indexes.
See this <a href="https://www.arangodb.com/2012/03/31/using-hilbert-curves-and-polyhedrons-for-geo-indexing" target="_blank">blog</a>
for details.</p>
<p>A geo-spatial index assumes that the latitude is between -90 and 90 degree and
the longitude is between -180 and 180 degree. A geo index will ignore all
documents which do not fulfill these requirements.</p>
<p><a name="accessing_geo_indexes_from_the_shell"></a></p>
<h2 id="accessing-geo-indexes-from-the-shell">Accessing Geo Indexes from the Shell</h2>
<!-- js/server/modules/org/arangodb/arango-collection.js-->
<p><code>collection.ensureGeoIndex(location)</code></p>
<p>Creates a geo-spatial index on all documents using <em>location</em> as path to
the coordinates. The value of the attribute must be an array with at least two
numeric values. The array must contain the latitude (first value) and the
longitude (second value).</p>
<p>All documents, which do not have the attribute path or have a non-conforming
value in it are excluded from the index.</p>
<p>A geo index is implicitly sparse, and there is no way to control its sparsity.</p>
<p>In case that the index was successfully created, an object with the index
details, including the index-identifier, is returned.</p>
<p><code>collection.ensureGeoIndex(location, true)</code></p>
<p>As above whith the exception, that the order within the array is longitude
followed by latitude. This corresponds to the format described in
<a href="http://geojson.org/geojson-spec.html" target="_blank">positions</a></p>
<p><code>collection.ensureGeoIndex(latitude, longitude)</code></p>
<p>Creates a geo-spatial index on all documents using <em>latitude</em> and
<em>longitude</em> as paths the latitude and the longitude. The values of the
attributes <em>latitude</em> and <em>longitude</em> must be numeric.
All documents, which do not have the attribute paths or
have non-conforming values in the index attributes are excluded from the index.</p>
<p>Geo indexes are always sparse, meaning that documents which do not contain
the index attributes or have non-numeric values in the index attributes
will not be indexed.</p>
<p>In case that the index was successfully created, an object with the index
details, including the index-identifier, is returned.</p>
<p><strong>Examples</strong></p>
<p>Create a geo index for an array attribute:</p>
<div id="geoIndexCreateForArrayAttribute_container">
<div id="geoIndexCreateForArrayAttribute_long" onclick="" style="Display: none;">
<pre>
arangosh&gt; db.geo.ensureGeoIndex(&quot;loc&quot;);
{
&quot;id&quot; : &quot;geo/1358821589&quot;,
&quot;type&quot; : &quot;geo1&quot;,
&quot;fields&quot; : [
&quot;loc&quot;
],
&quot;geoJson&quot; : false,
&quot;constraint&quot; : false,
&quot;unique&quot; : false,
&quot;ignoreNull&quot; : true,
&quot;sparse&quot; : true,
&quot;isNewlyCreated&quot; : true,
&quot;code&quot; : 201
}
arangosh&gt; for (i = -90; i <= 90;="" i="" +="10)" {="" ........=""> for (j = -180; j <= 180;="" j="" +="10)" {="" ........=""> db.geo.save({ name : &quot;Name/&quot; + i + &quot;/&quot; + j, loc: [ i, j ] });
........&gt; }
........&gt; }
arangosh&gt; db.geo.count();
703
arangosh&gt; db.geo.near(0, 0).limit(3).toArray();
[
{
&quot;_id&quot; : &quot;geo/1428224213&quot;,
&quot;_key&quot; : &quot;1428224213&quot;,
&quot;_rev&quot; : &quot;1428224213&quot;,
&quot;name&quot; : &quot;Name/0/0&quot;,
&quot;loc&quot; : [
0,
0
]
},
{
&quot;_id&quot; : &quot;geo/1428420821&quot;,
&quot;_key&quot; : &quot;1428420821&quot;,
&quot;_rev&quot; : &quot;1428420821&quot;,
&quot;name&quot; : &quot;Name/0/10&quot;,
&quot;loc&quot; : [
0,
10
]
},
{
&quot;_id&quot; : &quot;geo/1420949717&quot;,
&quot;_key&quot; : &quot;1420949717&quot;,
&quot;_rev&quot; : &quot;1420949717&quot;,
&quot;name&quot; : &quot;Name/-10/0&quot;,
&quot;loc&quot; : [
-10,
0
]
}
]
arangosh&gt; db.geo.near(0, 0).count();
null
</=></=></pre>
</div>
<div id="geoIndexCreateForArrayAttribute_short" onclick="$(&apos;#geoIndexCreateForArrayAttribute_short&apos;).hide(); $(&apos;#geoIndexCreateForArrayAttribute_long&apos;).show();">
<pre>
arangosh&gt; db.geo.ensureGeoIndex(&quot;loc&quot;);
arangosh&gt; for (i = -90; i <= 90;="" i="" +="10)" {="" ........=""> for (j = -180; j <= 180;="" j="" +="10)" {="" ........=""> db.geo.save({ name : &quot;Name/&quot; + i + &quot;/&quot; + j, loc: [ i, j ] });
........&gt; }
........&gt; }
arangosh&gt; db.geo.count();
arangosh&gt; db.geo.near(0, 0).limit(3).toArray();
arangosh&gt; db.geo.near(0, 0).count();
</=></=></pre><div class="example_show_button">show execution results</div>
</div>
</div>
<p>Create a geo index for a hash array attribute:</p>
<div id="geoIndexCreateForArrayAttribute2_container">
<div id="geoIndexCreateForArrayAttribute2_long" onclick="" style="Display: none;">
<pre>
arangosh&gt; db.geo2.ensureGeoIndex(&quot;location.latitude&quot;, &quot;location.longitude&quot;);
{
&quot;id&quot; : &quot;geo2/1498872021&quot;,
&quot;type&quot; : &quot;geo2&quot;,
&quot;fields&quot; : [
&quot;location.latitude&quot;,
&quot;location.longitude&quot;
],
&quot;constraint&quot; : false,
&quot;unique&quot; : false,
&quot;ignoreNull&quot; : true,
&quot;sparse&quot; : true,
&quot;isNewlyCreated&quot; : true,
&quot;code&quot; : 201
}
arangosh&gt; for (i = -90; i <= 90;="" i="" +="10)" {="" ........=""> for (j = -180; j <= 180;="" j="" +="10)" {="" ........=""> db.geo2.save({ name : &quot;Name/&quot; + i + &quot;/&quot; + j, location: { latitude : i, longitude : j } });
........&gt; }
........&gt; }
arangosh&gt; db.geo2.near(0, 0).limit(3).toArray();
[
{
&quot;_id&quot; : &quot;geo2/1568274645&quot;,
&quot;_key&quot; : &quot;1568274645&quot;,
&quot;_rev&quot; : &quot;1568274645&quot;,
&quot;location&quot; : {
&quot;latitude&quot; : 0,
&quot;longitude&quot; : 0
},
&quot;name&quot; : &quot;Name/0/0&quot;
},
{
&quot;_id&quot; : &quot;geo2/1568471253&quot;,
&quot;_key&quot; : &quot;1568471253&quot;,
&quot;_rev&quot; : &quot;1568471253&quot;,
&quot;location&quot; : {
&quot;latitude&quot; : 0,
&quot;longitude&quot; : 10
},
&quot;name&quot; : &quot;Name/0/10&quot;
},
{
&quot;_id&quot; : &quot;geo2/1561000149&quot;,
&quot;_key&quot; : &quot;1561000149&quot;,
&quot;_rev&quot; : &quot;1561000149&quot;,
&quot;location&quot; : {
&quot;latitude&quot; : -10,
&quot;longitude&quot; : 0
},
&quot;name&quot; : &quot;Name/-10/0&quot;
}
]
</=></=></pre>
</div>
<div id="geoIndexCreateForArrayAttribute2_short" onclick="$(&apos;#geoIndexCreateForArrayAttribute2_short&apos;).hide(); $(&apos;#geoIndexCreateForArrayAttribute2_long&apos;).show();">
<pre>
arangosh&gt; db.geo2.ensureGeoIndex(&quot;location.latitude&quot;, &quot;location.longitude&quot;);
arangosh&gt; for (i = -90; i <= 90;="" i="" +="10)" {="" ........=""> for (j = -180; j <= 180;="" j="" +="10)" {="" ........=""> db.geo2.save({ name : &quot;Name/&quot; + i + &quot;/&quot; + j, location: { latitude : i, longitude : j } });
........&gt; }
........&gt; }
arangosh&gt; db.geo2.near(0, 0).limit(3).toArray();
</=></=></pre><div class="example_show_button">show execution results</div>
</div>
</div>
<!-- js/common/modules/org/arangodb/arango-collection-common.js-->
<p><code>collection.geo(location-attribute)</code></p>
<p>Looks up a geo index defined on attribute <em>location_attribute</em>.</p>
<p>Returns a geo index object if an index was found. The <code>near</code> or
<code>within</code> operators can then be used to execute a geo-spatial query on
this particular index.</p>
<p>This is useful for collections with multiple defined geo indexes.</p>
<p><code>collection.geo(location_attribute, true)</code></p>
<p>Looks up a geo index on a compound attribute <em>location_attribute</em>.</p>
<p>Returns a geo index object if an index was found. The <code>near</code> or
<code>within</code> operators can then be used to execute a geo-spatial query on
this particular index.</p>
<p><code>collection.geo(latitude_attribute, longitude_attribute)</code></p>
<p>Looks up a geo index defined on the two attributes <em>latitude_attribute</em>
and <em>longitude-attribute</em>.</p>
<p>Returns a geo index object if an index was found. The <code>near</code> or
<code>within</code> operators can then be used to execute a geo-spatial query on
this particular index.</p>
<p>Note: the <em>geo</em> simple query helper function is <strong>deprecated</strong> as of ArangoDB
2.6. The function may be removed in future versions of ArangoDB. The preferred
way for running geo queries is to use their AQL equivalents.</p>
<p><strong>Examples</strong></p>
<p>Assume you have a location stored as list in the attribute <em>home</em>
and a destination stored in the attribute <em>work</em>. Then you can use the
<code>geo</code> operator to select which geo-spatial attributes (and thus which
index) to use in a <code>near</code> query.</p>
<div id="geoIndexSimpleQuery_container">
<div id="geoIndexSimpleQuery_long" onclick="" style="Display: none;">
<pre>
arangosh&gt; for (i = -90; i <= 90;="" i="" +="10)" {="" ........=""> for (j = -180; j <= 180;="" j="" +="10)" {="" ........=""> db.complex.save({ name : &quot;Name/&quot; + i + &quot;/&quot; + j,
........&gt; home : [ i, j ],
........&gt; work : [ -i, -j ] });
........&gt; }
........&gt; }
........&gt;
arangosh&gt; db.complex.near(0, 170).limit(5);
[ArangoError 1570: no suitable geo index found for geo restriction on &apos;complex&apos;]
arangosh&gt; db.complex.ensureGeoIndex(&quot;home&quot;);
{
&quot;id&quot; : &quot;complex/1776548053&quot;,
&quot;type&quot; : &quot;geo1&quot;,
&quot;fields&quot; : [
&quot;home&quot;
],
&quot;geoJson&quot; : false,
&quot;constraint&quot; : false,
&quot;unique&quot; : false,
&quot;ignoreNull&quot; : true,
&quot;sparse&quot; : true,
&quot;isNewlyCreated&quot; : true,
&quot;code&quot; : 201
}
arangosh&gt; db.complex.near(0, 170).limit(5).toArray();
[
{
&quot;_id&quot; : &quot;complex/1710618837&quot;,
&quot;_key&quot; : &quot;1710618837&quot;,
&quot;_rev&quot; : &quot;1710618837&quot;,
&quot;name&quot; : &quot;Name/0/170&quot;,
&quot;home&quot; : [
0,
170
],
&quot;work&quot; : [
0,
-170
]
},
{
&quot;_id&quot; : &quot;complex/1710815445&quot;,
&quot;_key&quot; : &quot;1710815445&quot;,
&quot;_rev&quot; : &quot;1710815445&quot;,
&quot;name&quot; : &quot;Name/0/180&quot;,
&quot;home&quot; : [
0,
180
],
&quot;work&quot; : [
0,
-180
]
},
{
&quot;_id&quot; : &quot;complex/1717893333&quot;,
&quot;_key&quot; : &quot;1717893333&quot;,
&quot;_rev&quot; : &quot;1717893333&quot;,
&quot;name&quot; : &quot;Name/10/170&quot;,
&quot;home&quot; : [
10,
170
],
&quot;work&quot; : [
-10,
-170
]
},
{
&quot;_id&quot; : &quot;complex/1703344341&quot;,
&quot;_key&quot; : &quot;1703344341&quot;,
&quot;_rev&quot; : &quot;1703344341&quot;,
&quot;name&quot; : &quot;Name/-10/170&quot;,
&quot;home&quot; : [
-10,
170
],
&quot;work&quot; : [
10,
-170
]
},
{
&quot;_id&quot; : &quot;complex/1703737557&quot;,
&quot;_key&quot; : &quot;1703737557&quot;,
&quot;_rev&quot; : &quot;1703737557&quot;,
&quot;name&quot; : &quot;Name/0/-180&quot;,
&quot;home&quot; : [
0,
-180
],
&quot;work&quot; : [
0,
180
]
}
]
arangosh&gt; db.complex.geo(&quot;work&quot;).near(0, 170).limit(5);
[ArangoError 1570: no suitable geo index found for geo restriction on &apos;complex&apos;]
arangosh&gt; db.complex.ensureGeoIndex(&quot;work&quot;);
{
&quot;id&quot; : &quot;complex/1777072341&quot;,
&quot;type&quot; : &quot;geo1&quot;,
&quot;fields&quot; : [
&quot;work&quot;
],
&quot;geoJson&quot; : false,
&quot;constraint&quot; : false,
&quot;unique&quot; : false,
&quot;ignoreNull&quot; : true,
&quot;sparse&quot; : true,
&quot;isNewlyCreated&quot; : true,
&quot;code&quot; : 201
}
arangosh&gt; db.complex.geo(&quot;work&quot;).near(0, 170).limit(5).toArray();
[
{
&quot;_id&quot; : &quot;complex/1703934165&quot;,
&quot;_key&quot; : &quot;1703934165&quot;,
&quot;_rev&quot; : &quot;1703934165&quot;,
&quot;name&quot; : &quot;Name/0/-170&quot;,
&quot;home&quot; : [
0,
-170
],
&quot;work&quot; : [
0,
170
]
},
{
&quot;_id&quot; : &quot;complex/1703737557&quot;,
&quot;_key&quot; : &quot;1703737557&quot;,
&quot;_rev&quot; : &quot;1703737557&quot;,
&quot;name&quot; : &quot;Name/0/-180&quot;,
&quot;home&quot; : [
0,
-180
],
&quot;work&quot; : [
0,
180
]
},
{
&quot;_id&quot; : &quot;complex/1696659669&quot;,
&quot;_key&quot; : &quot;1696659669&quot;,
&quot;_rev&quot; : &quot;1696659669&quot;,
&quot;name&quot; : &quot;Name/-10/-170&quot;,
&quot;home&quot; : [
-10,
-170
],
&quot;work&quot; : [
10,
170
]
},
{
&quot;_id&quot; : &quot;complex/1711208661&quot;,
&quot;_key&quot; : &quot;1711208661&quot;,
&quot;_rev&quot; : &quot;1711208661&quot;,
&quot;name&quot; : &quot;Name/10/-170&quot;,
&quot;home&quot; : [
10,
-170
],
&quot;work&quot; : [
-10,
170
]
},
{
&quot;_id&quot; : &quot;complex/1710815445&quot;,
&quot;_key&quot; : &quot;1710815445&quot;,
&quot;_rev&quot; : &quot;1710815445&quot;,
&quot;name&quot; : &quot;Name/0/180&quot;,
&quot;home&quot; : [
0,
180
],
&quot;work&quot; : [
0,
-180
]
}
]
</=></=></pre>
</div>
<div id="geoIndexSimpleQuery_short" onclick="$(&apos;#geoIndexSimpleQuery_short&apos;).hide(); $(&apos;#geoIndexSimpleQuery_long&apos;).show();">
<pre>
arangosh&gt; for (i = -90; i <= 90;="" i="" +="10)" {="" ........=""> for (j = -180; j <= 180;="" j="" +="10)" {="" ........=""> db.complex.save({ name : &quot;Name/&quot; + i + &quot;/&quot; + j,
........&gt; home : [ i, j ],
........&gt; work : [ -i, -j ] });
........&gt; }
........&gt; }
........&gt;
arangosh&gt; db.complex.near(0, 170).limit(5);
arangosh&gt; db.complex.ensureGeoIndex(&quot;home&quot;);
arangosh&gt; db.complex.near(0, 170).limit(5).toArray();
arangosh&gt; db.complex.geo(&quot;work&quot;).near(0, 170).limit(5);
arangosh&gt; db.complex.ensureGeoIndex(&quot;work&quot;);
arangosh&gt; db.complex.geo(&quot;work&quot;).near(0, 170).limit(5).toArray();
</=></=></pre><div class="example_show_button">show execution results</div>
</div>
</div>
<!-- js/common/modules/org/arangodb/arango-collection-common.js-->
<p><code>collection.near(latitude, longitude)</code></p>
<p>The returned list is sorted according to the distance, with the nearest
document to the coordinate (<em>latitude</em>, <em>longitude</em>) coming first.
If there are near documents of equal distance, documents are chosen randomly
from this set until the limit is reached. It is possible to change the limit
using the <em>limit</em> operator.</p>
<p>In order to use the <em>near</em> operator, a geo index must be defined for the
collection. This index also defines which attribute holds the coordinates
for the document. If you have more then one geo-spatial index, you can use
the <em>geo</em> operator to select a particular index.</p>
<p><em>Note</em>: <code>near</code> does not support negative skips.
// However, you can still use <code>limit</code> followed to skip.</p>
<p><code>collection.near(latitude, longitude).limit(limit)</code></p>
<p>Limits the result to limit documents instead of the default 100.</p>
<p><em>Note</em>: Unlike with multiple explicit limits, <code>limit</code> will raise
the implicit default limit imposed by <code>within</code>.</p>
<p><code>collection.near(latitude, longitude).distance()</code></p>
<p>This will add an attribute <code>distance</code> to all documents returned, which
contains the distance between the given point and the document in meters.</p>
<p><code>collection.near(latitude, longitude).distance(name)</code></p>
<p>This will add an attribute <em>name</em> to all documents returned, which
contains the distance between the given point and the document in meters.</p>
<p>Note: the <em>near</em> simple query function is <strong>deprecated</strong> as of ArangoDB 2.6.
The function may be removed in future versions of ArangoDB. The preferred
way for retrieving documents from a collection using the near operator is
to use the AQL <em>NEAR</em> function in an <a href="../Aql/GeoFunctions.html">AQL query</a> as follows: </p>
<pre><code>FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit)
RETURN doc
</code></pre><p><strong>Examples</strong></p>
<p>To get the nearest two locations:</p>
<div id="007_collectionNear_container">
<div id="007_collectionNear_long" onclick="" style="Display: none;">
<pre>
arangosh&gt; db.geo.ensureGeoIndex(&quot;loc&quot;);
{
&quot;id&quot; : &quot;geo/36763861&quot;,
&quot;type&quot; : &quot;geo1&quot;,
&quot;fields&quot; : [
&quot;loc&quot;
],
&quot;geoJson&quot; : false,
&quot;constraint&quot; : false,
&quot;unique&quot; : false,
&quot;ignoreNull&quot; : true,
&quot;sparse&quot; : true,
&quot;isNewlyCreated&quot; : true,
&quot;code&quot; : 201
}
arangosh&gt; for (var i = -90; i <= 90;="" i="" +="10)" {="" for="" (var="" j="-180;" <="180;" db.geo.save({="" name="" :="" "Name="" "="" j,="" loc:="" [="" i,="" ]="" });="" }="" arangosh=""> db.geo.near(0, 0).limit(2).toArray();
[
{
&quot;_id&quot; : &quot;geo/106166485&quot;,
&quot;_key&quot; : &quot;106166485&quot;,
&quot;_rev&quot; : &quot;106166485&quot;,
&quot;name&quot; : &quot;Name/0/0&quot;,
&quot;loc&quot; : [
0,
0
]
},
{
&quot;_id&quot; : &quot;geo/98891989&quot;,
&quot;_key&quot; : &quot;98891989&quot;,
&quot;_rev&quot; : &quot;98891989&quot;,
&quot;name&quot; : &quot;Name/-10/0&quot;,
&quot;loc&quot; : [
-10,
0
]
}
]
</=></pre>
</div>
<div id="007_collectionNear_short" onclick="$(&apos;#007_collectionNear_short&apos;).hide(); $(&apos;#007_collectionNear_long&apos;).show();">
<pre>
arangosh&gt; db.geo.ensureGeoIndex(&quot;loc&quot;);
arangosh&gt; for (var i = -90; i <= 90;="" i="" +="10)" {="" for="" (var="" j="-180;" <="180;" db.geo.save({="" name="" :="" "Name="" "="" j,="" loc:="" [="" i,="" ]="" });="" }="" arangosh=""> db.geo.near(0, 0).limit(2).toArray();
</=></pre><div class="example_show_button">show execution results</div>
</div>
</div>
<p>If you need the distance as well, then you can use the <code>distance</code>
operator:</p>
<div id="008_collectionNearDistance_container">
<div id="008_collectionNearDistance_long" onclick="" style="Display: none;">
<pre>
arangosh&gt; db.geo.ensureGeoIndex(&quot;loc&quot;);
{
&quot;id&quot; : &quot;geo/175896789&quot;,
&quot;type&quot; : &quot;geo1&quot;,
&quot;fields&quot; : [
&quot;loc&quot;
],
&quot;geoJson&quot; : false,
&quot;constraint&quot; : false,
&quot;unique&quot; : false,
&quot;ignoreNull&quot; : true,
&quot;sparse&quot; : true,
&quot;isNewlyCreated&quot; : true,
&quot;code&quot; : 201
}
arangosh&gt; for (var i = -90; i <= 90;="" i="" +="10)" {="" for="" (var="" j="-180;" <="180;" db.geo.save({="" name="" :="" "Name="" "="" j,="" loc:="" [="" i,="" ]="" });="" }="" arangosh=""> db.geo.near(0, 0).distance().limit(2).toArray();
[
{
&quot;_id&quot; : &quot;geo/245299413&quot;,
&quot;_key&quot; : &quot;245299413&quot;,
&quot;_rev&quot; : &quot;245299413&quot;,
&quot;name&quot; : &quot;Name/0/0&quot;,
&quot;loc&quot; : [
0,
0
],
&quot;distance&quot; : 0
},
{
&quot;_id&quot; : &quot;geo/238024917&quot;,
&quot;_key&quot; : &quot;238024917&quot;,
&quot;_rev&quot; : &quot;238024917&quot;,
&quot;name&quot; : &quot;Name/-10/0&quot;,
&quot;loc&quot; : [
-10,
0
],
&quot;distance&quot; : 1111949.2664455874
}
]
</=></pre>
</div>
<div id="008_collectionNearDistance_short" onclick="$(&apos;#008_collectionNearDistance_short&apos;).hide(); $(&apos;#008_collectionNearDistance_long&apos;).show();">
<pre>
arangosh&gt; db.geo.ensureGeoIndex(&quot;loc&quot;);
arangosh&gt; for (var i = -90; i <= 90;="" i="" +="10)" {="" for="" (var="" j="-180;" <="180;" db.geo.save({="" name="" :="" "Name="" "="" j,="" loc:="" [="" i,="" ]="" });="" }="" arangosh=""> db.geo.near(0, 0).distance().limit(2).toArray();
</=></pre><div class="example_show_button">show execution results</div>
</div>
</div>
<!-- js/common/modules/org/arangodb/arango-collection-common.js-->
<p><code>collection.within(latitude, longitude, radius)</code></p>
<p>This will find all documents within a given radius around the coordinate
(<em>latitude</em>, <em>longitude</em>). The returned array is sorted by distance,
beginning with the nearest document.</p>
<p>In order to use the <em>within</em> operator, a geo index must be defined for the
collection. This index also defines which attribute holds the coordinates
for the document. If you have more then one geo-spatial index, you can use
the <code>geo</code> operator to select a particular index.</p>
<p><code>collection.within(latitude, longitude, radius).distance()</code></p>
<p>This will add an attribute <code>_distance</code> to all documents returned, which
contains the distance between the given point and the document in meters.</p>
<p><code>collection.within(latitude, longitude, radius).distance(name)</code></p>
<p>This will add an attribute <em>name</em> to all documents returned, which
contains the distance between the given point and the document in meters.</p>
<p>Note: the <em>within</em> simple query function is <strong>deprecated</strong> as of ArangoDB 2.6.
The function may be removed in future versions of ArangoDB. The preferred
way for retrieving documents from a collection using the within operator is
to use the AQL <em>WITHIN</em> function in an <a href="../Aql/GeoFunctions.html">AQL query</a> as follows: </p>
<pre><code>FOR doc IN WITHIN(@@collection, @latitude, @longitude, @radius, @distanceAttributeName)
RETURN doc
</code></pre><p><strong>Examples</strong></p>
<p>To find all documents within a radius of 2000 km use:</p>
<div id="009_collectionWithin_container">
<div id="009_collectionWithin_long" onclick="" style="Display: none;">
<pre>
arangosh&gt; db.geo.within(0, 0, 2000 * 1000).distance().toArray();
[
{
&quot;_id&quot; : &quot;geo/384432341&quot;,
&quot;_key&quot; : &quot;384432341&quot;,
&quot;_rev&quot; : &quot;384432341&quot;,
&quot;name&quot; : &quot;Name/0/0&quot;,
&quot;loc&quot; : [
0,
0
],
&quot;distance&quot; : 0
},
{
&quot;_id&quot; : &quot;geo/377157845&quot;,
&quot;_key&quot; : &quot;377157845&quot;,
&quot;_rev&quot; : &quot;377157845&quot;,
&quot;name&quot; : &quot;Name/-10/0&quot;,
&quot;loc&quot; : [
-10,
0
],
&quot;distance&quot; : 1111949.2664455874
},
{
&quot;_id&quot; : &quot;geo/384628949&quot;,
&quot;_key&quot; : &quot;384628949&quot;,
&quot;_rev&quot; : &quot;384628949&quot;,
&quot;name&quot; : &quot;Name/0/10&quot;,
&quot;loc&quot; : [
0,
10
],
&quot;distance&quot; : 1111949.2664455874
},
{
&quot;_id&quot; : &quot;geo/391706837&quot;,
&quot;_key&quot; : &quot;391706837&quot;,
&quot;_rev&quot; : &quot;391706837&quot;,
&quot;name&quot; : &quot;Name/10/0&quot;,
&quot;loc&quot; : [
10,
0
],
&quot;distance&quot; : 1111949.2664455874
},
{
&quot;_id&quot; : &quot;geo/384235733&quot;,
&quot;_key&quot; : &quot;384235733&quot;,
&quot;_rev&quot; : &quot;384235733&quot;,
&quot;name&quot; : &quot;Name/0/-10&quot;,
&quot;loc&quot; : [
0,
-10
],
&quot;distance&quot; : 1111949.2664455874
},
{
&quot;_id&quot; : &quot;geo/377354453&quot;,
&quot;_key&quot; : &quot;377354453&quot;,
&quot;_rev&quot; : &quot;377354453&quot;,
&quot;name&quot; : &quot;Name/-10/10&quot;,
&quot;loc&quot; : [
-10,
10
],
&quot;distance&quot; : 1568520.556798576
},
{
&quot;_id&quot; : &quot;geo/391903445&quot;,
&quot;_key&quot; : &quot;391903445&quot;,
&quot;_rev&quot; : &quot;391903445&quot;,
&quot;name&quot; : &quot;Name/10/10&quot;,
&quot;loc&quot; : [
10,
10
],
&quot;distance&quot; : 1568520.556798576
},
{
&quot;_id&quot; : &quot;geo/376961237&quot;,
&quot;_key&quot; : &quot;376961237&quot;,
&quot;_rev&quot; : &quot;376961237&quot;,
&quot;name&quot; : &quot;Name/-10/-10&quot;,
&quot;loc&quot; : [
-10,
-10
],
&quot;distance&quot; : 1568520.556798576
},
{
&quot;_id&quot; : &quot;geo/391510229&quot;,
&quot;_key&quot; : &quot;391510229&quot;,
&quot;_rev&quot; : &quot;391510229&quot;,
&quot;name&quot; : &quot;Name/10/-10&quot;,
&quot;loc&quot; : [
10,
-10
],
&quot;distance&quot; : 1568520.556798576
}
]
</pre>
</div>
<div id="009_collectionWithin_short" onclick="$(&apos;#009_collectionWithin_short&apos;).hide(); $(&apos;#009_collectionWithin_long&apos;).show();">
<pre>
arangosh&gt; db.geo.within(0, 0, 2000 * 1000).distance().toArray();
</pre><div class="example_show_button">show execution results</div>
</div>
</div>
</section>
</div>
</div>
</div>
<a href="../IndexHandling/Fulltext.html" class="navigation navigation-prev " aria-label="Previous page: Fulltext Indexes"><i class="fa fa-angle-left"></i></a>
<a href="../IndexHandling/Cap.html" class="navigation navigation-next " aria-label="Next page: Cap Constraint"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"fontSettings":{"theme":null,"family":"sans","size":2},"addcssjs":{"js":["styles/header.js"],"css":["styles/header.css"]}};
gitbook.start(config);
});
</script>
</body>
</html>

Geo Indexes

Introduction to Geo Indexes

This is an introduction to ArangoDB's geo indexes.

ArangoDB uses Hilbert curves to implement geo-spatial indexes. See this blog for details.

A geo-spatial index assumes that the latitude is between -90 and 90 degree and the longitude is between -180 and 180 degree. A geo index will ignore all documents which do not fulfill these requirements.

Accessing Geo Indexes from the Shell

collection.ensureGeoIndex(location)

Creates a geo-spatial index on all documents using location as path to the coordinates. The value of the attribute must be an array with at least two numeric values. The array must contain the latitude (first value) and the longitude (second value).

All documents, which do not have the attribute path or have a non-conforming value in it are excluded from the index.

A geo index is implicitly sparse, and there is no way to control its sparsity.

In case that the index was successfully created, an object with the index details, including the index-identifier, is returned.

collection.ensureGeoIndex(location, true)

As above whith the exception, that the order within the array is longitude followed by latitude. This corresponds to the format described in positions

collection.ensureGeoIndex(latitude, longitude)

Creates a geo-spatial index on all documents using latitude and longitude as paths the latitude and the longitude. The values of the attributes latitude and longitude must be numeric. All documents, which do not have the attribute paths or have non-conforming values in the index attributes are excluded from the index.

Geo indexes are always sparse, meaning that documents which do not contain the index attributes or have non-numeric values in the index attributes will not be indexed.

In case that the index was successfully created, an object with the index details, including the index-identifier, is returned.

Examples

Create a geo index for an array attribute:

arangosh> db.geo.ensureGeoIndex("loc");
{ 
  "id" : "geo/1358821589", 
  "type" : "geo1", 
  "fields" : [ 
    "loc" 
  ], 
  "geoJson" : false, 
  "constraint" : false, 
  "unique" : false, 
  "ignoreNull" : true, 
  "sparse" : true, 
  "isNewlyCreated" : true, 
  "code" : 201 
}
arangosh> for (i = -90;  i <= 90;  i += 10) {
........>     for (j = -180; j <= 180; j += 10) {
........>         db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] });
........>     }
........> }	
arangosh> db.geo.count();
703
arangosh> db.geo.near(0, 0).limit(3).toArray();
[ 
  { 
    "_id" : "geo/1428224213", 
    "_key" : "1428224213", 
    "_rev" : "1428224213", 
    "name" : "Name/0/0", 
    "loc" : [ 
      0, 
      0 
    ] 
  }, 
  { 
    "_id" : "geo/1428420821", 
    "_key" : "1428420821", 
    "_rev" : "1428420821", 
    "name" : "Name/0/10", 
    "loc" : [ 
      0, 
      10 
    ] 
  }, 
  { 
    "_id" : "geo/1420949717", 
    "_key" : "1420949717", 
    "_rev" : "1420949717", 
    "name" : "Name/-10/0", 
    "loc" : [ 
      -10, 
      0 
    ] 
  } 
]
arangosh> db.geo.near(0, 0).count();
null
arangosh> db.geo.ensureGeoIndex("loc");
arangosh> for (i = -90;  i <= 90;  i += 10) {
........>     for (j = -180; j <= 180; j += 10) {
........>         db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] });
........>     }
........> }	
arangosh> db.geo.count();
arangosh> db.geo.near(0, 0).limit(3).toArray();
arangosh> db.geo.near(0, 0).count();
show execution results

Create a geo index for a hash array attribute:

arangosh> db.geo2.ensureGeoIndex("location.latitude", "location.longitude");
{ 
  "id" : "geo2/1498872021", 
  "type" : "geo2", 
  "fields" : [ 
    "location.latitude", 
    "location.longitude" 
  ], 
  "constraint" : false, 
  "unique" : false, 
  "ignoreNull" : true, 
  "sparse" : true, 
  "isNewlyCreated" : true, 
  "code" : 201 
}
arangosh> for (i = -90;  i <= 90;  i += 10) {
........>     for (j = -180; j <= 180; j += 10) {
........>         db.geo2.save({ name : "Name/" + i + "/" + j, location: { latitude : i, longitude : j } });
........>     }
........> }	
arangosh> db.geo2.near(0, 0).limit(3).toArray();
[ 
  { 
    "_id" : "geo2/1568274645", 
    "_key" : "1568274645", 
    "_rev" : "1568274645", 
    "location" : { 
      "latitude" : 0, 
      "longitude" : 0 
    }, 
    "name" : "Name/0/0" 
  }, 
  { 
    "_id" : "geo2/1568471253", 
    "_key" : "1568471253", 
    "_rev" : "1568471253", 
    "location" : { 
      "latitude" : 0, 
      "longitude" : 10 
    }, 
    "name" : "Name/0/10" 
  }, 
  { 
    "_id" : "geo2/1561000149", 
    "_key" : "1561000149", 
    "_rev" : "1561000149", 
    "location" : { 
      "latitude" : -10, 
      "longitude" : 0 
    }, 
    "name" : "Name/-10/0" 
  } 
]
arangosh> db.geo2.ensureGeoIndex("location.latitude", "location.longitude");
arangosh> for (i = -90;  i <= 90;  i += 10) {
........>     for (j = -180; j <= 180; j += 10) {
........>         db.geo2.save({ name : "Name/" + i + "/" + j, location: { latitude : i, longitude : j } });
........>     }
........> }	
arangosh> db.geo2.near(0, 0).limit(3).toArray();
show execution results

collection.geo(location-attribute)

Looks up a geo index defined on attribute location_attribute.

Returns a geo index object if an index was found. The near or within operators can then be used to execute a geo-spatial query on this particular index.

This is useful for collections with multiple defined geo indexes.

collection.geo(location_attribute, true)

Looks up a geo index on a compound attribute location_attribute.

Returns a geo index object if an index was found. The near or within operators can then be used to execute a geo-spatial query on this particular index.

collection.geo(latitude_attribute, longitude_attribute)

Looks up a geo index defined on the two attributes latitude_attribute and longitude-attribute.

Returns a geo index object if an index was found. The near or within operators can then be used to execute a geo-spatial query on this particular index.

Note: the geo simple query helper function is deprecated as of ArangoDB 2.6. The function may be removed in future versions of ArangoDB. The preferred way for running geo queries is to use their AQL equivalents.

Examples

Assume you have a location stored as list in the attribute home and a destination stored in the attribute work. Then you can use the geo operator to select which geo-spatial attributes (and thus which index) to use in a near query.

arangosh> for (i = -90;  i <= 90;  i += 10) {
........>  for (j = -180;  j <= 180;  j += 10) {
........>    db.complex.save({ name : "Name/" + i + "/" + j,
........>                      home : [ i, j ],
........>                      work : [ -i, -j ] });
........>  }
........> }
........> 
arangosh> db.complex.near(0, 170).limit(5);
[ArangoError 1570: no suitable geo index found for geo restriction on 'complex']
arangosh> db.complex.ensureGeoIndex("home");
{ 
  "id" : "complex/1776548053", 
  "type" : "geo1", 
  "fields" : [ 
    "home" 
  ], 
  "geoJson" : false, 
  "constraint" : false, 
  "unique" : false, 
  "ignoreNull" : true, 
  "sparse" : true, 
  "isNewlyCreated" : true, 
  "code" : 201 
}
arangosh> db.complex.near(0, 170).limit(5).toArray();
[ 
  { 
    "_id" : "complex/1710618837", 
    "_key" : "1710618837", 
    "_rev" : "1710618837", 
    "name" : "Name/0/170", 
    "home" : [ 
      0, 
      170 
    ], 
    "work" : [ 
      0, 
      -170 
    ] 
  }, 
  { 
    "_id" : "complex/1710815445", 
    "_key" : "1710815445", 
    "_rev" : "1710815445", 
    "name" : "Name/0/180", 
    "home" : [ 
      0, 
      180 
    ], 
    "work" : [ 
      0, 
      -180 
    ] 
  }, 
  { 
    "_id" : "complex/1717893333", 
    "_key" : "1717893333", 
    "_rev" : "1717893333", 
    "name" : "Name/10/170", 
    "home" : [ 
      10, 
      170 
    ], 
    "work" : [ 
      -10, 
      -170 
    ] 
  }, 
  { 
    "_id" : "complex/1703344341", 
    "_key" : "1703344341", 
    "_rev" : "1703344341", 
    "name" : "Name/-10/170", 
    "home" : [ 
      -10, 
      170 
    ], 
    "work" : [ 
      10, 
      -170 
    ] 
  }, 
  { 
    "_id" : "complex/1703737557", 
    "_key" : "1703737557", 
    "_rev" : "1703737557", 
    "name" : "Name/0/-180", 
    "home" : [ 
      0, 
      -180 
    ], 
    "work" : [ 
      0, 
      180 
    ] 
  } 
]
arangosh> db.complex.geo("work").near(0, 170).limit(5);
[ArangoError 1570: no suitable geo index found for geo restriction on 'complex']
arangosh> db.complex.ensureGeoIndex("work");
{ 
  "id" : "complex/1777072341", 
  "type" : "geo1", 
  "fields" : [ 
    "work" 
  ], 
  "geoJson" : false, 
  "constraint" : false, 
  "unique" : false, 
  "ignoreNull" : true, 
  "sparse" : true, 
  "isNewlyCreated" : true, 
  "code" : 201 
}
arangosh> db.complex.geo("work").near(0, 170).limit(5).toArray();
[ 
  { 
    "_id" : "complex/1703934165", 
    "_key" : "1703934165", 
    "_rev" : "1703934165", 
    "name" : "Name/0/-170", 
    "home" : [ 
      0, 
      -170 
    ], 
    "work" : [ 
      0, 
      170 
    ] 
  }, 
  { 
    "_id" : "complex/1703737557", 
    "_key" : "1703737557", 
    "_rev" : "1703737557", 
    "name" : "Name/0/-180", 
    "home" : [ 
      0, 
      -180 
    ], 
    "work" : [ 
      0, 
      180 
    ] 
  }, 
  { 
    "_id" : "complex/1696659669", 
    "_key" : "1696659669", 
    "_rev" : "1696659669", 
    "name" : "Name/-10/-170", 
    "home" : [ 
      -10, 
      -170 
    ], 
    "work" : [ 
      10, 
      170 
    ] 
  }, 
  { 
    "_id" : "complex/1711208661", 
    "_key" : "1711208661", 
    "_rev" : "1711208661", 
    "name" : "Name/10/-170", 
    "home" : [ 
      10, 
      -170 
    ], 
    "work" : [ 
      -10, 
      170 
    ] 
  }, 
  { 
    "_id" : "complex/1710815445", 
    "_key" : "1710815445", 
    "_rev" : "1710815445", 
    "name" : "Name/0/180", 
    "home" : [ 
      0, 
      180 
    ], 
    "work" : [ 
      0, 
      -180 
    ] 
  } 
]
arangosh> for (i = -90;  i <= 90;  i += 10) {
........>  for (j = -180;  j <= 180;  j += 10) {
........>    db.complex.save({ name : "Name/" + i + "/" + j,
........>                      home : [ i, j ],
........>                      work : [ -i, -j ] });
........>  }
........> }
........> 
arangosh> db.complex.near(0, 170).limit(5);
arangosh> db.complex.ensureGeoIndex("home");
arangosh> db.complex.near(0, 170).limit(5).toArray();
arangosh> db.complex.geo("work").near(0, 170).limit(5);
arangosh> db.complex.ensureGeoIndex("work");
arangosh> db.complex.geo("work").near(0, 170).limit(5).toArray();
show execution results

collection.near(latitude, longitude)

The returned list is sorted according to the distance, with the nearest document to the coordinate (latitude, longitude) coming first. If there are near documents of equal distance, documents are chosen randomly from this set until the limit is reached. It is possible to change the limit using the limit operator.

In order to use the near operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the geo operator to select a particular index.

Note: near does not support negative skips. // However, you can still use limit followed to skip.

collection.near(latitude, longitude).limit(limit)

Limits the result to limit documents instead of the default 100.

Note: Unlike with multiple explicit limits, limit will raise the implicit default limit imposed by within.

collection.near(latitude, longitude).distance()

This will add an attribute distance to all documents returned, which contains the distance between the given point and the document in meters.

collection.near(latitude, longitude).distance(name)

This will add an attribute name to all documents returned, which contains the distance between the given point and the document in meters.

Note: the near simple query function is deprecated as of ArangoDB 2.6. The function may be removed in future versions of ArangoDB. The preferred way for retrieving documents from a collection using the near operator is to use the AQL NEAR function in an AQL query as follows:

FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit) 
  RETURN doc

Examples

To get the nearest two locations:

arangosh> db.geo.ensureGeoIndex("loc");
{ 
  "id" : "geo/36763861", 
  "type" : "geo1", 
  "fields" : [ 
    "loc" 
  ], 
  "geoJson" : false, 
  "constraint" : false, 
  "unique" : false, 
  "ignoreNull" : true, 
  "sparse" : true, 
  "isNewlyCreated" : true, 
  "code" : 201 
}
arangosh> for (var i = -90;  i <= 90;  i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
arangosh> db.geo.near(0, 0).limit(2).toArray();
[ 
  { 
    "_id" : "geo/106166485", 
    "_key" : "106166485", 
    "_rev" : "106166485", 
    "name" : "Name/0/0", 
    "loc" : [ 
      0, 
      0 
    ] 
  }, 
  { 
    "_id" : "geo/98891989", 
    "_key" : "98891989", 
    "_rev" : "98891989", 
    "name" : "Name/-10/0", 
    "loc" : [ 
      -10, 
      0 
    ] 
  } 
]
arangosh> db.geo.ensureGeoIndex("loc");
arangosh> for (var i = -90;  i <= 90;  i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
arangosh> db.geo.near(0, 0).limit(2).toArray();
show execution results

If you need the distance as well, then you can use the distance operator:

arangosh> db.geo.ensureGeoIndex("loc");
{ 
  "id" : "geo/175896789", 
  "type" : "geo1", 
  "fields" : [ 
    "loc" 
  ], 
  "geoJson" : false, 
  "constraint" : false, 
  "unique" : false, 
  "ignoreNull" : true, 
  "sparse" : true, 
  "isNewlyCreated" : true, 
  "code" : 201 
}
arangosh> for (var i = -90;  i <= 90;  i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
arangosh> db.geo.near(0, 0).distance().limit(2).toArray();
[ 
  { 
    "_id" : "geo/245299413", 
    "_key" : "245299413", 
    "_rev" : "245299413", 
    "name" : "Name/0/0", 
    "loc" : [ 
      0, 
      0 
    ], 
    "distance" : 0 
  }, 
  { 
    "_id" : "geo/238024917", 
    "_key" : "238024917", 
    "_rev" : "238024917", 
    "name" : "Name/-10/0", 
    "loc" : [ 
      -10, 
      0 
    ], 
    "distance" : 1111949.2664455874 
  } 
]
arangosh> db.geo.ensureGeoIndex("loc");
arangosh> for (var i = -90;  i <= 90;  i += 10) { for (var j = -180; j <= 180; j += 10) { db.geo.save({ name : "Name/" + i + "/" + j, loc: [ i, j ] }); } }
arangosh> db.geo.near(0, 0).distance().limit(2).toArray();
show execution results

collection.within(latitude, longitude, radius)

This will find all documents within a given radius around the coordinate (latitude, longitude). The returned array is sorted by distance, beginning with the nearest document.

In order to use the within operator, a geo index must be defined for the collection. This index also defines which attribute holds the coordinates for the document. If you have more then one geo-spatial index, you can use the geo operator to select a particular index.

collection.within(latitude, longitude, radius).distance()

This will add an attribute _distance to all documents returned, which contains the distance between the given point and the document in meters.

collection.within(latitude, longitude, radius).distance(name)

This will add an attribute name to all documents returned, which contains the distance between the given point and the document in meters.

Note: the within simple query function is deprecated as of ArangoDB 2.6. The function may be removed in future versions of ArangoDB. The preferred way for retrieving documents from a collection using the within operator is to use the AQL WITHIN function in an AQL query as follows:

FOR doc IN WITHIN(@@collection, @latitude, @longitude, @radius, @distanceAttributeName)
  RETURN doc

Examples

To find all documents within a radius of 2000 km use:

arangosh> db.geo.within(0, 0, 2000 * 1000).distance().toArray();
[ 
  { 
    "_id" : "geo/384432341", 
    "_key" : "384432341", 
    "_rev" : "384432341", 
    "name" : "Name/0/0", 
    "loc" : [ 
      0, 
      0 
    ], 
    "distance" : 0 
  }, 
  { 
    "_id" : "geo/377157845", 
    "_key" : "377157845", 
    "_rev" : "377157845", 
    "name" : "Name/-10/0", 
    "loc" : [ 
      -10, 
      0 
    ], 
    "distance" : 1111949.2664455874 
  }, 
  { 
    "_id" : "geo/384628949", 
    "_key" : "384628949", 
    "_rev" : "384628949", 
    "name" : "Name/0/10", 
    "loc" : [ 
      0, 
      10 
    ], 
    "distance" : 1111949.2664455874 
  }, 
  { 
    "_id" : "geo/391706837", 
    "_key" : "391706837", 
    "_rev" : "391706837", 
    "name" : "Name/10/0", 
    "loc" : [ 
      10, 
      0 
    ], 
    "distance" : 1111949.2664455874 
  }, 
  { 
    "_id" : "geo/384235733", 
    "_key" : "384235733", 
    "_rev" : "384235733", 
    "name" : "Name/0/-10", 
    "loc" : [ 
      0, 
      -10 
    ], 
    "distance" : 1111949.2664455874 
  }, 
  { 
    "_id" : "geo/377354453", 
    "_key" : "377354453", 
    "_rev" : "377354453", 
    "name" : "Name/-10/10", 
    "loc" : [ 
      -10, 
      10 
    ], 
    "distance" : 1568520.556798576 
  }, 
  { 
    "_id" : "geo/391903445", 
    "_key" : "391903445", 
    "_rev" : "391903445", 
    "name" : "Name/10/10", 
    "loc" : [ 
      10, 
      10 
    ], 
    "distance" : 1568520.556798576 
  }, 
  { 
    "_id" : "geo/376961237", 
    "_key" : "376961237", 
    "_rev" : "376961237", 
    "name" : "Name/-10/-10", 
    "loc" : [ 
      -10, 
      -10 
    ], 
    "distance" : 1568520.556798576 
  }, 
  { 
    "_id" : "geo/391510229", 
    "_key" : "391510229", 
    "_rev" : "391510229", 
    "name" : "Name/10/-10", 
    "loc" : [ 
      10, 
      -10 
    ], 
    "distance" : 1568520.556798576 
  } 
]
arangosh> db.geo.within(0, 0, 2000 * 1000).distance().toArray();
show execution results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment