1
0
Fork 0
arangodb/Documentation/Scripts/allComments.txt

58517 lines
2.9 MiB

@startDocuBlock errorCodes
################################################################################
## General errors
################################################################################
ERROR_NO_ERROR,0,"no error","No error has occurred."
ERROR_FAILED,1,"failed","Will be raised when a general error occurred."
ERROR_SYS_ERROR,2,"system error","Will be raised when operating system error occurred."
ERROR_OUT_OF_MEMORY,3,"out of memory","Will be raised when there is a memory shortage."
ERROR_INTERNAL,4,"internal error","Will be raised when an internal error occurred."
ERROR_ILLEGAL_NUMBER,5,"illegal number","Will be raised when an illegal representation of a number was given."
ERROR_NUMERIC_OVERFLOW,6,"numeric overflow","Will be raised when a numeric overflow occurred."
ERROR_ILLEGAL_OPTION,7,"illegal option","Will be raised when an unknown option was supplied by the user."
ERROR_DEAD_PID,8,"dead process identifier","Will be raised when a PID without a living process was found."
ERROR_NOT_IMPLEMENTED,9,"not implemented","Will be raised when hitting an unimplemented feature."
ERROR_BAD_PARAMETER,10,"bad parameter","Will be raised when the parameter does not fulfill the requirements."
ERROR_FORBIDDEN,11,"forbidden","Will be raised when you are missing permission for the operation."
ERROR_OUT_OF_MEMORY_MMAP,12,"out of memory in mmap","Will be raised when there is a memory shortage."
ERROR_CORRUPTED_CSV,13,"csv is corrupt","Will be raised when encountering a corrupt csv line."
ERROR_FILE_NOT_FOUND,14,"file not found","Will be raised when a file is not found."
ERROR_CANNOT_WRITE_FILE,15,"cannot write file","Will be raised when a file cannot be written."
ERROR_CANNOT_OVERWRITE_FILE,16,"cannot overwrite file","Will be raised when an attempt is made to overwrite an existing file."
ERROR_TYPE_ERROR,17,"type error","Will be raised when a type error is encountered."
ERROR_LOCK_TIMEOUT,18,"lock timeout","Will be raised when there's a timeout waiting for a lock."
ERROR_CANNOT_CREATE_DIRECTORY,19,"cannot create directory","Will be raised when an attempt to create a directory fails."
ERROR_CANNOT_CREATE_TEMP_FILE,20,"cannot create temporary file","Will be raised when an attempt to create a temporary file fails."
ERROR_REQUEST_CANCELED,21,"canceled request","Will be raised when a request is canceled by the user."
ERROR_DEBUG,22,"intentional debug error","Will be raised intentionally during debugging."
ERROR_IP_ADDRESS_INVALID,25,"IP address is invalid","Will be raised when the structure of an IP address is invalid."
ERROR_FILE_EXISTS,27,"file exists","Will be raised when a file already exists."
ERROR_LOCKED,28,"locked","Will be raised when a resource or an operation is locked."
ERROR_DEADLOCK,29,"deadlock detected","Will be raised when a deadlock is detected when accessing collections."
ERROR_SHUTTING_DOWN,30,"shutdown in progress","Will be raised when a call cannot succeed because a server shutdown is already in progress."
ERROR_ONLY_ENTERPRISE,31,"only enterprise version","Will be raised when an enterprise-feature is requested from the community edition."
ERROR_RESOURCE_LIMIT,32,"resource limit exceeded","Will be raised when the resources used by an operation exceed the configured maximum value."
ERROR_ARANGO_ICU_ERROR,33,"icu error: %s","will be raised if icu operations failed"
ERROR_CANNOT_READ_FILE,34,"cannot read file","Will be raised when a file cannot be read."
ERROR_INCOMPATIBLE_VERSION,35,"incompatible server version","Will be raised when a server is running an incompatible version of ArangoDB."
ERROR_DISABLED,36,"disabled","Will be raised when a requested resource is not enabled."
################################################################################
## HTTP error status codes
################################################################################
ERROR_HTTP_BAD_PARAMETER,400,"bad parameter","Will be raised when the HTTP request does not fulfill the requirements."
ERROR_HTTP_UNAUTHORIZED,401,"unauthorized","Will be raised when authorization is required but the user is not authorized."
ERROR_HTTP_FORBIDDEN,403,"forbidden","Will be raised when the operation is forbidden."
ERROR_HTTP_NOT_FOUND,404,"not found","Will be raised when an URI is unknown."
ERROR_HTTP_METHOD_NOT_ALLOWED,405,"method not supported","Will be raised when an unsupported HTTP method is used for an operation."
ERROR_HTTP_NOT_ACCEPTABLE,406,"request not acceptable","Will be raised when an unsupported HTTP content type is used for an operation, or if a request is not acceptable for a leader or follower."
ERROR_HTTP_PRECONDITION_FAILED,412,"precondition failed","Will be raised when a precondition for an HTTP request is not met."
ERROR_HTTP_SERVER_ERROR,500,"internal server error","Will be raised when an internal server is encountered."
ERROR_HTTP_SERVICE_UNAVAILABLE,503,"service unavailable","Will be raised when a service is temporarily unavailable."
ERROR_HTTP_GATEWAY_TIMEOUT,504,"gateway timeout","Will be raised when a service contacted by ArangoDB does not respond in a timely manner."
################################################################################
## HTTP processing errors
################################################################################
ERROR_HTTP_CORRUPTED_JSON,600,"invalid JSON object","Will be raised when a string representation of a JSON object is corrupt."
ERROR_HTTP_SUPERFLUOUS_SUFFICES,601,"superfluous URL suffices","Will be raised when the URL contains superfluous suffices."
################################################################################
## Internal ArangoDB storage errors
## For errors that occur because of a programming error.
################################################################################
ERROR_ARANGO_ILLEGAL_STATE,1000,"illegal state","Internal error that will be raised when the datafile is not in the required state."
ERROR_ARANGO_DATAFILE_SEALED,1002,"datafile sealed","Internal error that will be raised when trying to write to a datafile."
ERROR_ARANGO_READ_ONLY,1004,"read only","Internal error that will be raised when trying to write to a read-only datafile or collection."
ERROR_ARANGO_DUPLICATE_IDENTIFIER,1005,"duplicate identifier","Internal error that will be raised when a identifier duplicate is detected."
ERROR_ARANGO_DATAFILE_UNREADABLE,1006,"datafile unreadable","Internal error that will be raised when a datafile is unreadable."
ERROR_ARANGO_DATAFILE_EMPTY,1007,"datafile empty","Internal error that will be raised when a datafile is empty."
ERROR_ARANGO_RECOVERY,1008,"logfile recovery error","Will be raised when an error occurred during WAL log file recovery."
ERROR_ARANGO_DATAFILE_STATISTICS_NOT_FOUND,1009,"datafile statistics not found","Will be raised when a required datafile statistics object was not found."
################################################################################
## External ArangoDB storage errors
## For errors that occur because of an outside event.
################################################################################
ERROR_ARANGO_CORRUPTED_DATAFILE,1100,"corrupted datafile","Will be raised when a corruption is detected in a datafile."
ERROR_ARANGO_ILLEGAL_PARAMETER_FILE,1101,"illegal or unreadable parameter file","Will be raised if a parameter file is corrupted or cannot be read."
ERROR_ARANGO_CORRUPTED_COLLECTION,1102,"corrupted collection","Will be raised when a collection contains one or more corrupted data files."
ERROR_ARANGO_MMAP_FAILED,1103,"mmap failed","Will be raised when the system call mmap failed."
ERROR_ARANGO_FILESYSTEM_FULL,1104,"filesystem full","Will be raised when the filesystem is full."
ERROR_ARANGO_NO_JOURNAL,1105,"no journal","Will be raised when a journal cannot be created."
ERROR_ARANGO_DATAFILE_ALREADY_EXISTS,1106,"cannot create/rename datafile because it already exists","Will be raised when the datafile cannot be created or renamed because a file of the same name already exists."
ERROR_ARANGO_DATADIR_LOCKED,1107,"database directory is locked","Will be raised when the database directory is locked by a different process."
ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS,1108,"cannot create/rename collection because directory already exists","Will be raised when the collection cannot be created because a directory of the same name already exists."
ERROR_ARANGO_MSYNC_FAILED,1109,"msync failed","Will be raised when the system call msync failed."
ERROR_ARANGO_DATADIR_UNLOCKABLE,1110,"cannot lock database directory","Will be raised when the server cannot lock the database directory on startup."
ERROR_ARANGO_SYNC_TIMEOUT,1111,"sync timeout","Will be raised when the server waited too long for a datafile to be synced to disk."
################################################################################
## General ArangoDB storage errors
## For errors that occur when fulfilling a user request.
################################################################################
ERROR_ARANGO_CONFLICT,1200,"conflict","Will be raised when updating or deleting a document and a conflict has been detected."
ERROR_ARANGO_DATADIR_INVALID,1201,"invalid database directory","Will be raised when a non-existing database directory was specified when starting the database."
ERROR_ARANGO_DOCUMENT_NOT_FOUND,1202,"document not found","Will be raised when a document with a given identifier or handle is unknown."
ERROR_ARANGO_DATA_SOURCE_NOT_FOUND,1203,"collection or view not found","Will be raised when a collection with the given identifier or name is unknown."
ERROR_ARANGO_COLLECTION_PARAMETER_MISSING,1204,"parameter 'collection' not found","Will be raised when the collection parameter is missing."
ERROR_ARANGO_DOCUMENT_HANDLE_BAD,1205,"illegal document handle","Will be raised when a document handle is corrupt."
ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL,1206,"maximal size of journal too small","Will be raised when the maximal size of the journal is too small."
ERROR_ARANGO_DUPLICATE_NAME,1207,"duplicate name","Will be raised when a name duplicate is detected."
ERROR_ARANGO_ILLEGAL_NAME,1208,"illegal name","Will be raised when an illegal name is detected."
ERROR_ARANGO_NO_INDEX,1209,"no suitable index known","Will be raised when no suitable index for the query is known."
ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED,1210,"unique constraint violated","Will be raised when there is a unique constraint violation."
ERROR_ARANGO_INDEX_NOT_FOUND,1212,"index not found","Will be raised when an index with a given identifier is unknown."
ERROR_ARANGO_CROSS_COLLECTION_REQUEST,1213,"cross collection request not allowed","Will be raised when a cross-collection is requested."
ERROR_ARANGO_INDEX_HANDLE_BAD,1214,"illegal index handle","Will be raised when a index handle is corrupt."
ERROR_ARANGO_DOCUMENT_TOO_LARGE,1216,"document too large","Will be raised when the document cannot fit into any datafile because of it is too large."
ERROR_ARANGO_COLLECTION_NOT_UNLOADED,1217,"collection must be unloaded","Will be raised when a collection should be unloaded, but has a different status."
ERROR_ARANGO_COLLECTION_TYPE_INVALID,1218,"collection type invalid","Will be raised when an invalid collection type is used in a request."
ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED,1220,"parsing attribute name definition failed","Will be raised when parsing an attribute name definition failed."
ERROR_ARANGO_DOCUMENT_KEY_BAD,1221,"illegal document key","Will be raised when a document key is corrupt."
ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED,1222,"unexpected document key","Will be raised when a user-defined document key is supplied for collections with auto key generation."
ERROR_ARANGO_DATADIR_NOT_WRITABLE,1224,"server database directory not writable","Will be raised when the server's database directory is not writable for the current user."
ERROR_ARANGO_OUT_OF_KEYS,1225,"out of keys","Will be raised when a key generator runs out of keys."
ERROR_ARANGO_DOCUMENT_KEY_MISSING,1226,"missing document key","Will be raised when a document key is missing."
ERROR_ARANGO_DOCUMENT_TYPE_INVALID,1227,"invalid document type","Will be raised when there is an attempt to create a document with an invalid type."
ERROR_ARANGO_DATABASE_NOT_FOUND,1228,"database not found","Will be raised when a non-existing database is accessed."
ERROR_ARANGO_DATABASE_NAME_INVALID,1229,"database name invalid","Will be raised when an invalid database name is used."
ERROR_ARANGO_USE_SYSTEM_DATABASE,1230,"operation only allowed in system database","Will be raised when an operation is requested in a database other than the system database."
ERROR_ARANGO_INVALID_KEY_GENERATOR,1232,"invalid key generator","Will be raised when an invalid key generator description is used."
ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE,1233,"edge attribute missing or invalid","will be raised when the _from or _to values of an edge are undefined or contain an invalid value."
ERROR_ARANGO_INDEX_CREATION_FAILED,1235,"index creation failed","Will be raised when an attempt to create an index has failed."
ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT,1236,"write-throttling timeout","Will be raised when the server is write-throttled and a write operation has waited too long for the server to process queued operations."
ERROR_ARANGO_COLLECTION_TYPE_MISMATCH,1237,"collection type mismatch","Will be raised when a collection has a different type from what has been expected."
ERROR_ARANGO_COLLECTION_NOT_LOADED,1238,"collection not loaded","Will be raised when a collection is accessed that is not yet loaded."
ERROR_ARANGO_DOCUMENT_REV_BAD,1239,"illegal document revision","Will be raised when a document revision is corrupt or is missing where needed."
ERROR_ARANGO_INCOMPLETE_READ,1240,"incomplete read","Will be raised by the storage engine when a read cannot be completed."
################################################################################
## Checked ArangoDB storage errors
## For errors that occur but are anticipated.
################################################################################
ERROR_ARANGO_DATAFILE_FULL,1300,"datafile full","Will be raised when the datafile reaches its limit."
ERROR_ARANGO_EMPTY_DATADIR,1301,"server database directory is empty","Will be raised when encountering an empty server database directory."
ERROR_ARANGO_TRY_AGAIN,1302,"operation should be tried again","Will be raised when an operation should be retried."
ERROR_ARANGO_BUSY,1303,"engine is busy","Will be raised when storage engine is busy."
ERROR_ARANGO_MERGE_IN_PROGRESS,1304,"merge in progress","Will be raised when storage engine has a datafile merge in progress and cannot complete the operation."
ERROR_ARANGO_IO_ERROR,1305,"storage engine I/O error","Will be raised when storage engine encounters an I/O error."
################################################################################
## ArangoDB replication errors
################################################################################
ERROR_REPLICATION_NO_RESPONSE,1400,"no response","Will be raised when the replication applier does not receive any or an incomplete response from the master."
ERROR_REPLICATION_INVALID_RESPONSE,1401,"invalid response","Will be raised when the replication applier receives an invalid response from the master."
ERROR_REPLICATION_MASTER_ERROR,1402,"master error","Will be raised when the replication applier receives a server error from the master."
ERROR_REPLICATION_MASTER_INCOMPATIBLE,1403,"master incompatible","Will be raised when the replication applier connects to a master that has an incompatible version."
ERROR_REPLICATION_MASTER_CHANGE,1404,"master change","Will be raised when the replication applier connects to a different master than before."
ERROR_REPLICATION_LOOP,1405,"loop detected","Will be raised when the replication applier is asked to connect to itself for replication."
ERROR_REPLICATION_UNEXPECTED_MARKER,1406,"unexpected marker","Will be raised when an unexpected marker is found in the replication log stream."
ERROR_REPLICATION_INVALID_APPLIER_STATE,1407,"invalid applier state","Will be raised when an invalid replication applier state file is found."
ERROR_REPLICATION_UNEXPECTED_TRANSACTION,1408,"invalid transaction","Will be raised when an unexpected transaction id is found."
ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION,1410,"invalid replication applier configuration","Will be raised when the configuration for the replication applier is invalid."
ERROR_REPLICATION_RUNNING,1411,"cannot perform operation while applier is running","Will be raised when there is an attempt to perform an operation while the replication applier is running."
ERROR_REPLICATION_APPLIER_STOPPED,1412,"replication stopped","Special error code used to indicate the replication applier was stopped by a user."
ERROR_REPLICATION_NO_START_TICK,1413,"no start tick","Will be raised when the replication applier is started without a known start tick value."
ERROR_REPLICATION_START_TICK_NOT_PRESENT,1414,"start tick not present","Will be raised when the replication applier fetches data using a start tick, but that start tick is not present on the logger server anymore."
ERROR_REPLICATION_WRONG_CHECKSUM,1416,"wrong checksum","Will be raised when a new born follower submits a wrong checksum"
ERROR_REPLICATION_SHARD_NONEMPTY,1417,"shard not empty","Will be raised when a shard is not empty and the follower tries a shortcut"
################################################################################
## ArangoDB cluster errors
################################################################################
ERROR_CLUSTER_SERVER_UNKNOWN,1449,"got a request from an unkown server","Will be raised on some occasions when one server gets a request from another, which has not (yet?) been made known via the agency."
ERROR_CLUSTER_TOO_MANY_SHARDS,1450,"too many shards","Will be raised when the number of shards for a collection is higher than allowed."
ERROR_CLUSTER_COLLECTION_ID_EXISTS,1453,"collection ID already exists","Will be raised when a coordinator in a cluster tries to create a collection and the collection ID already exists."
ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN,1454,"could not create collection in plan","Will be raised when a coordinator in a cluster cannot create an entry for a new collection in the Plan hierarchy in the agency."
ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION,1456,"could not create collection","Will be raised when a coordinator in a cluster notices that some DBServers report problems when creating shards for a new collection."
ERROR_CLUSTER_TIMEOUT,1457,"timeout in cluster operation","Will be raised when a coordinator in a cluster runs into a timeout for some cluster wide operation."
ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN,1458,"could not remove collection from plan","Will be raised when a coordinator in a cluster cannot remove an entry for a collection in the Plan hierarchy in the agency."
ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT,1459,"could not remove collection from current","Will be raised when a coordinator in a cluster cannot remove an entry for a collection in the Current hierarchy in the agency."
ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN,1460,"could not create database in plan","Will be raised when a coordinator in a cluster cannot create an entry for a new database in the Plan hierarchy in the agency."
ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE,1461,"could not create database","Will be raised when a coordinator in a cluster notices that some DBServers report problems when creating databases for a new cluster wide database."
ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN,1462,"could not remove database from plan","Will be raised when a coordinator in a cluster cannot remove an entry for a database in the Plan hierarchy in the agency."
ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT,1463,"could not remove database from current","Will be raised when a coordinator in a cluster cannot remove an entry for a database in the Current hierarchy in the agency."
ERROR_CLUSTER_SHARD_GONE,1464,"no responsible shard found","Will be raised when a coordinator in a cluster cannot determine the shard that is responsible for a given document."
ERROR_CLUSTER_CONNECTION_LOST,1465,"cluster internal HTTP connection broken","Will be raised when a coordinator in a cluster loses an HTTP connection to a DBserver in the cluster whilst transferring data."
ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY,1466,"must not specify _key for this collection","Will be raised when a coordinator in a cluster finds that the _key attribute was specified in a sharded collection the uses not only _key as sharding attribute."
ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS,1467,"got contradicting answers from different shards","Will be raised if a coordinator in a cluster gets conflicting results from different shards, which should never happen."
ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN,1468,"not all sharding attributes given","Will be raised if a coordinator tries to find out which shard is responsible for a partial document, but cannot do this because not all sharding attributes are specified."
ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES,1469,"must not change the value of a shard key attribute","Will be raised if there is an attempt to update the value of a shard attribute."
ERROR_CLUSTER_UNSUPPORTED,1470,"unsupported operation or parameter","Will be raised when there is an attempt to carry out an operation that is not supported in the context of a sharded collection."
ERROR_CLUSTER_ONLY_ON_COORDINATOR,1471,"this operation is only valid on a coordinator in a cluster","Will be raised if there is an attempt to run a coordinator-only operation on a different type of node."
ERROR_CLUSTER_READING_PLAN_AGENCY,1472,"error reading Plan in agency","Will be raised if a coordinator or DBserver cannot read the Plan in the agency."
ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION,1473,"could not truncate collection","Will be raised if a coordinator cannot truncate all shards of a cluster collection."
ERROR_CLUSTER_AQL_COMMUNICATION,1474,"error in cluster internal communication for AQL","Will be raised if the internal communication of the cluster for AQL produces an error."
ERROR_CLUSTER_ONLY_ON_DBSERVER,1477,"this operation is only valid on a DBserver in a cluster","Will be raised if there is an attempt to run a DBserver-only operation on a different type of node."
ERROR_CLUSTER_BACKEND_UNAVAILABLE,1478,"A cluster backend which was required for the operation could not be reached","Will be raised if a required db server can't be reached."
ERROR_CLUSTER_AQL_COLLECTION_OUT_OF_SYNC,1481,"collection is out of sync","Will be raised if a collection needed during query execution is out of sync. This currently can only happen when using satellite collections"
ERROR_CLUSTER_COULD_NOT_CREATE_INDEX_IN_PLAN,1482,"could not create index in plan","Will be raised when a coordinator in a cluster cannot create an entry for a new index in the Plan hierarchy in the agency."
ERROR_CLUSTER_COULD_NOT_DROP_INDEX_IN_PLAN,1483,"could not drop index in plan","Will be raised when a coordinator in a cluster cannot remove an index from the Plan hierarchy in the agency."
ERROR_CLUSTER_CHAIN_OF_DISTRIBUTESHARDSLIKE,1484,"chain of distributeShardsLike references","Will be raised if one tries to create a collection with a distributeShardsLike attribute which points to another collection that also has one."
ERROR_CLUSTER_MUST_NOT_DROP_COLL_OTHER_DISTRIBUTESHARDSLIKE,1485,"must not drop collection while another has a distributeShardsLike attribute pointing to it","Will be raised if one tries to drop a collection to which another collection points with its distributeShardsLike attribute."
ERROR_CLUSTER_UNKNOWN_DISTRIBUTESHARDSLIKE,1486,"must not have a distributeShardsLike attribute pointing to an unknown collection","Will be raised if one tries to create a collection which points to an unknown collection in its distributeShardsLike attribute."
ERROR_CLUSTER_INSUFFICIENT_DBSERVERS,1487,"the number of current dbservers is lower than the requested replicationFactor","Will be raised if one tries to create a collection with a replicationFactor greater than the available number of DBServers."
ERROR_CLUSTER_COULD_NOT_DROP_FOLLOWER,1488,"a follower could not be dropped in agency","Will be raised if a follower that ought to be dropped could not be dropped in the agency (under Current)."
ERROR_CLUSTER_SHARD_LEADER_REFUSES_REPLICATION,1489,"a shard leader refuses to perform a replication operation","Will be raised if a replication operation is refused by a shard leader."
ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION,1490,"a shard follower refuses to perform an operation that is not a replication","Will be raised if a non-replication operation is refused by a shard follower."
ERROR_CLUSTER_SHARD_LEADER_RESIGNED,1491,"a (former) shard leader refuses to perform an operation, because it has resigned in the meantime","Will be raised if a non-replication operation is refused by a former shard leader that has found out that it is no longer the leader."
ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED,1492,"some agency operation failed","Will be raised if after various retries an agency operation could not be performed successfully."
ERROR_CLUSTER_LEADERSHIP_CHALLENGE_ONGOING,1495,"leadership challenge is ongoing","Will be raised when servers are currently competing for leadership, and the result is still unknown."
ERROR_CLUSTER_NOT_LEADER,1496,"not a leader","Will be raised when an operation is sent to a non-leading server."
ERROR_CLUSTER_COULD_NOT_CREATE_VIEW_IN_PLAN,1497,"could not create view in plan","Will be raised when a coordinator in a cluster cannot create an entry for a new view in the Plan hierarchy in the agency."
ERROR_CLUSTER_VIEW_ID_EXISTS,1498,"view ID already exists","Will be raised when a coordinator in a cluster tries to create a view and the view ID already exists."
ERROR_CLUSTER_COULD_NOT_DROP_COLLECTION,1499,"could not drop collection in plan","Will be raised when a coordinator in a cluster cannot drop a collection entry in the Plan hierarchy in the agency."
################################################################################
## ArangoDB query errors
################################################################################
ERROR_QUERY_KILLED,1500,"query killed","Will be raised when a running query is killed by an explicit admin command."
ERROR_QUERY_PARSE,1501,"%s","Will be raised when query is parsed and is found to be syntactically invalid."
ERROR_QUERY_EMPTY,1502,"query is empty","Will be raised when an empty query is specified."
ERROR_QUERY_SCRIPT,1503,"runtime error '%s'","Will be raised when a runtime error is caused by the query."
ERROR_QUERY_NUMBER_OUT_OF_RANGE,1504,"number out of range","Will be raised when a number is outside the expected range."
ERROR_QUERY_INVALID_GEO_VALUE,1505,"invalid geo coordinate value","Will be raised when a geo index coordinate is invalid or out of range."
ERROR_QUERY_VARIABLE_NAME_INVALID,1510,"variable name '%s' has an invalid format","Will be raised when an invalid variable name is used."
ERROR_QUERY_VARIABLE_REDECLARED,1511,"variable '%s' is assigned multiple times","Will be raised when a variable gets re-assigned in a query."
ERROR_QUERY_VARIABLE_NAME_UNKNOWN,1512,"unknown variable '%s'","Will be raised when an unknown variable is used or the variable is undefined the context it is used."
ERROR_QUERY_COLLECTION_LOCK_FAILED,1521,"unable to read-lock collection %s","Will be raised when a read lock on the collection cannot be acquired."
ERROR_QUERY_TOO_MANY_COLLECTIONS,1522,"too many collections/shards","Will be raised when the number of collections or shards in a query is beyond the allowed value."
ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED,1530,"document attribute '%s' is assigned multiple times","Will be raised when a document attribute is re-assigned."
ERROR_QUERY_FUNCTION_NAME_UNKNOWN,1540,"usage of unknown function '%s()'","Will be raised when an undefined function is called."
ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH,1541,"invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d","Will be raised when the number of arguments used in a function call does not match the expected number of arguments for the function."
ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH,1542,"invalid argument type in call to function '%s()'","Will be raised when the type of an argument used in a function call does not match the expected argument type."
ERROR_QUERY_INVALID_REGEX,1543,"invalid regex value","Will be raised when an invalid regex argument value is used in a call to a function that expects a regex."
ERROR_QUERY_BIND_PARAMETERS_INVALID,1550,"invalid structure of bind parameters","Will be raised when the structure of bind parameters passed has an unexpected format."
ERROR_QUERY_BIND_PARAMETER_MISSING,1551,"no value specified for declared bind parameter '%s'","Will be raised when a bind parameter was declared in the query but the query is being executed with no value for that parameter."
ERROR_QUERY_BIND_PARAMETER_UNDECLARED,1552,"bind parameter '%s' was not declared in the query","Will be raised when a value gets specified for an undeclared bind parameter."
ERROR_QUERY_BIND_PARAMETER_TYPE,1553,"bind parameter '%s' has an invalid value or type","Will be raised when a bind parameter has an invalid value or type."
ERROR_QUERY_INVALID_LOGICAL_VALUE,1560,"invalid logical value","Will be raised when a non-boolean value is used in a logical operation."
ERROR_QUERY_INVALID_ARITHMETIC_VALUE,1561,"invalid arithmetic value","Will be raised when a non-numeric value is used in an arithmetic operation."
ERROR_QUERY_DIVISION_BY_ZERO,1562,"division by zero","Will be raised when there is an attempt to divide by zero."
ERROR_QUERY_ARRAY_EXPECTED,1563,"array expected","Will be raised when a non-array operand is used for an operation that expects an array argument operand."
ERROR_QUERY_FAIL_CALLED,1569,"FAIL(%s) called","Will be raised when the function FAIL() is called from inside a query."
ERROR_QUERY_GEO_INDEX_MISSING,1570,"no suitable geo index found for geo restriction on '%s'","Will be raised when a geo restriction was specified but no suitable geo index is found to resolve it."
ERROR_QUERY_FULLTEXT_INDEX_MISSING,1571,"no suitable fulltext index found for fulltext query on '%s'","Will be raised when a fulltext query is performed on a collection without a suitable fulltext index."
ERROR_QUERY_INVALID_DATE_VALUE,1572,"invalid date value","Will be raised when a value cannot be converted to a date."
ERROR_QUERY_MULTI_MODIFY,1573,"multi-modify query","Will be raised when an AQL query contains more than one data-modifying operation."
ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION,1574,"invalid aggregate expression","Will be raised when an AQL query contains an invalid aggregate expression."
ERROR_QUERY_COMPILE_TIME_OPTIONS,1575,"query options must be readable at query compile time","Will be raised when an AQL data-modification query contains options that cannot be figured out at query compile time."
ERROR_QUERY_EXCEPTION_OPTIONS,1576,"query options expected","Will be raised when an AQL data-modification query contains an invalid options specification."
ERROR_QUERY_FORCED_INDEX_HINT_UNUSABLE,1577,"could not use forced index hint","Will be raised when forceIndexHint is specified, and the hint cannot be used to serve the query."
ERROR_QUERY_DISALLOWED_DYNAMIC_CALL,1578,"disallowed dynamic call to '%s'","Will be raised when a dynamic function call is made to a function that cannot be called dynamically."
ERROR_QUERY_ACCESS_AFTER_MODIFICATION,1579,"access after data-modification by %s","Will be raised when collection data are accessed after a data-modification operation."
################################################################################
## AQL user function errors
################################################################################
ERROR_QUERY_FUNCTION_INVALID_NAME,1580,"invalid user function name","Will be raised when a user function with an invalid name is registered."
ERROR_QUERY_FUNCTION_INVALID_CODE,1581,"invalid user function code","Will be raised when a user function is registered with invalid code."
ERROR_QUERY_FUNCTION_NOT_FOUND,1582,"user function '%s()' not found","Will be raised when a user function is accessed but not found."
ERROR_QUERY_FUNCTION_RUNTIME_ERROR,1583,"user function runtime error: %s","Will be raised when a user function throws a runtime exception."
################################################################################
## AQL query registry errors
################################################################################
ERROR_QUERY_BAD_JSON_PLAN,1590,"bad execution plan JSON","Will be raised when an HTTP API for a query got an invalid JSON object."
ERROR_QUERY_NOT_FOUND,1591,"query ID not found","Will be raised when an Id of a query is not found by the HTTP API."
ERROR_QUERY_USER_ASSERT,1593,"%s","Will be raised if and user provided expression fails to evalutate to true"
ERROR_QUERY_USER_WARN,1594,"%s","Will be raised if and user provided expression fails to evalutate to true"
################################################################################
## ArangoDB cursor errors
################################################################################
ERROR_CURSOR_NOT_FOUND,1600,"cursor not found","Will be raised when a cursor is requested via its id but a cursor with that id cannot be found."
ERROR_CURSOR_BUSY,1601,"cursor is busy","Will be raised when a cursor is requested via its id but a concurrent request is still using the cursor."
################################################################################
## ArangoDB transaction errors
################################################################################
ERROR_TRANSACTION_INTERNAL,1650,"internal transaction error","Will be raised when a wrong usage of transactions is detected. this is an internal error and indicates a bug in ArangoDB."
ERROR_TRANSACTION_NESTED,1651,"nested transactions detected","Will be raised when transactions are nested."
ERROR_TRANSACTION_UNREGISTERED_COLLECTION,1652,"unregistered collection used in transaction","Will be raised when a collection is used in the middle of a transaction but was not registered at transaction start."
ERROR_TRANSACTION_DISALLOWED_OPERATION,1653,"disallowed operation inside transaction","Will be raised when a disallowed operation is carried out in a transaction."
ERROR_TRANSACTION_ABORTED,1654,"transaction aborted","Will be raised when a transaction was aborted."
ERROR_TRANSACTION_NOT_FOUND,1655,"transaction not found","Will be raised when a transaction was not found."
################################################################################
## User management errors
################################################################################
ERROR_USER_INVALID_NAME,1700,"invalid user name","Will be raised when an invalid user name is used."
ERROR_USER_DUPLICATE,1702,"duplicate user","Will be raised when a user name already exists."
ERROR_USER_NOT_FOUND,1703,"user not found","Will be raised when a user name is updated that does not exist."
ERROR_USER_EXTERNAL,1705,"user is external","Will be raised when the user is authenicated by an external server."
###############################################################################
## Service management errors (legacy)
## These have been superceded by the Foxx management errors in public APIs.
################################################################################
ERROR_SERVICE_DOWNLOAD_FAILED,1752,"service download failed","Will be raised when a service download from the central repository failed."
ERROR_SERVICE_UPLOAD_FAILED,1753,"service upload failed","Will be raised when a service upload from the client to the ArangoDB server failed."
################################################################################
## LDAP errors
################################################################################
ERROR_LDAP_CANNOT_INIT,1800,"cannot init a LDAP connection","can not init a LDAP connection"
ERROR_LDAP_CANNOT_SET_OPTION,1801,"cannot set a LDAP option","can not set a LDAP option"
ERROR_LDAP_CANNOT_BIND,1802,"cannot bind to a LDAP server","can not bind to a LDAP server"
ERROR_LDAP_CANNOT_UNBIND,1803,"cannot unbind from a LDAP server","can not unbind from a LDAP server"
ERROR_LDAP_CANNOT_SEARCH,1804,"cannot issue a LDAP search","can not search the LDAP server"
ERROR_LDAP_CANNOT_START_TLS,1805,"cannot start a TLS LDAP session","can not star a TLS LDAP session"
ERROR_LDAP_FOUND_NO_OBJECTS,1806,"LDAP didn't found any objects","LDAP didn't found any objects with the specified search query"
ERROR_LDAP_NOT_ONE_USER_FOUND,1807,"LDAP found zero ore more than one user","LDAP found zero ore more than one user"
ERROR_LDAP_USER_NOT_IDENTIFIED,1808,"LDAP found a user, but its not the desired one","LDAP found a user, but its not the desired one"
ERROR_LDAP_INVALID_MODE,1820,"invalid ldap mode","cant distinguish a valid mode for provided ldap configuration"
################################################################################
## Task errors
################################################################################
ERROR_TASK_INVALID_ID,1850,"invalid task id","Will be raised when a task is created with an invalid id."
ERROR_TASK_DUPLICATE_ID,1851,"duplicate task id","Will be raised when a task id is created with a duplicate id."
ERROR_TASK_NOT_FOUND,1852,"task not found","Will be raised when a task with the specified id could not be found."
################################################################################
## Graph / traversal errors
################################################################################
ERROR_GRAPH_INVALID_GRAPH,1901,"invalid graph","Will be raised when an invalid name is passed to the server."
ERROR_GRAPH_COULD_NOT_CREATE_GRAPH,1902,"could not create graph","Will be raised when an invalid name, vertices or edges is passed to the server."
ERROR_GRAPH_INVALID_VERTEX,1903,"invalid vertex","Will be raised when an invalid vertex id is passed to the server."
ERROR_GRAPH_COULD_NOT_CREATE_VERTEX,1904,"could not create vertex","Will be raised when the vertex could not be created."
ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX,1905,"could not change vertex","Will be raised when the vertex could not be changed."
ERROR_GRAPH_INVALID_EDGE,1906,"invalid edge","Will be raised when an invalid edge id is passed to the server."
ERROR_GRAPH_COULD_NOT_CREATE_EDGE,1907,"could not create edge","Will be raised when the edge could not be created."
ERROR_GRAPH_COULD_NOT_CHANGE_EDGE,1908,"could not change edge","Will be raised when the edge could not be changed."
ERROR_GRAPH_TOO_MANY_ITERATIONS,1909,"too many iterations - try increasing the value of 'maxIterations'","Will be raised when too many iterations are done in a graph traversal."
ERROR_GRAPH_INVALID_FILTER_RESULT,1910,"invalid filter result","Will be raised when an invalid filter result is returned in a graph traversal."
ERROR_GRAPH_COLLECTION_MULTI_USE,1920,"multi use of edge collection in edge def","an edge collection may only be used once in one edge definition of a graph.",
ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS,1921,"edge collection already used in edge def"," is already used by another graph in a different edge definition.",
ERROR_GRAPH_CREATE_MISSING_NAME,1922,"missing graph name","a graph name is required to create a graph.",
ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION,1923,"malformed edge definition","the edge definition is malformed. It has to be an array of objects.",
ERROR_GRAPH_NOT_FOUND,1924,"graph '%s' not found","a graph with this name could not be found.",
ERROR_GRAPH_DUPLICATE,1925,"graph already exists","a graph with this name already exists.",
ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST,1926,"vertex collection does not exist or is not part of the graph","the specified vertex collection does not exist or is not part of the graph.",
ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX,1927,"collection not a vertex collection","the collection is not a vertex collection.",
ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION,1928,"collection is not in list of orphan collections","Vertex collection not in list of orphan collections of the graph.",
ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF,1929,"collection already used in edge def","The collection is already used in an edge definition of the graph.",
ERROR_GRAPH_EDGE_COLLECTION_NOT_USED,1930,"edge collection not used in graph","The edge collection is not used in any edge definition of the graph.",
ERROR_GRAPH_NO_GRAPH_COLLECTION,1932,"collection _graphs does not exist","collection _graphs does not exist.",
ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING,1933,"Invalid example type. Has to be String, Array or Object","Invalid example type. Has to be String, Array or Object.",
ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT,1934,"Invalid example type. Has to be Array or Object","Invalid example type. Has to be Array or Object.",
ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS,1935,"Invalid number of arguments. Expected: ","Invalid number of arguments. Expected: ",
ERROR_GRAPH_INVALID_PARAMETER,1936,"Invalid parameter type.","Invalid parameter type.",
ERROR_GRAPH_INVALID_ID,1937,"Invalid id","Invalid id",
ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS,1938,"collection used in orphans","The collection is already used in the orphans of the graph.",
ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST,1939,"edge collection does not exist or is not part of the graph","the specified edge collection does not exist or is not part of the graph.",
ERROR_GRAPH_EMPTY,1940,"empty graph","The requested graph has no edge collections."
ERROR_GRAPH_INTERNAL_DATA_CORRUPT,1941,"internal graph data corrupt","The _graphs collection contains invalid data."
ERROR_GRAPH_INTERNAL_EDGE_COLLECTION_ALREADY_SET,1942,"edge collection already set","Tried to add an edge collection which is already defined."
ERROR_GRAPH_CREATE_MALFORMED_ORPHAN_LIST,1943,"malformed orphan list","the orphan list argument is malformed. It has to be an array of strings."
ERROR_GRAPH_EDGE_DEFINITION_IS_DOCUMENT,1944,"edge definition collection is a document collection","the collection used as a relation is existing, but is a document collection, it cannot be used here."
################################################################################
## Session errors
################################################################################
ERROR_SESSION_UNKNOWN,1950,"unknown session","Will be raised when an invalid/unknown session id is passed to the server."
ERROR_SESSION_EXPIRED,1951,"session expired","Will be raised when a session is expired."
################################################################################
## Simple Client errors
################################################################################
ERROR_SIMPLE_CLIENT_UNKNOWN_ERROR,2000,"unknown client error","This error should not happen."
ERROR_SIMPLE_CLIENT_COULD_NOT_CONNECT,2001,"could not connect to server","Will be raised when the client could not connect to the server."
ERROR_SIMPLE_CLIENT_COULD_NOT_WRITE,2002,"could not write to server","Will be raised when the client could not write data."
ERROR_SIMPLE_CLIENT_COULD_NOT_READ,2003,"could not read from server","Will be raised when the client could not read data."
################################################################################
## Communicator errors
################################################################################
ERROR_COMMUNICATOR_REQUEST_ABORTED,2100,"Request aborted","Request was aborted."
ERROR_COMMUNICATOR_DISABLED,2101,"Communication was disabled","Communication was disabled."
################################################################################
## internal AQL errors
################################################################################
ERROR_INTERNAL_AQL,2200,"General internal AQL error","Internal error during AQL execution"
ERROR_WROTE_TOO_FEW_OUTPUT_REGISTERS,2201,"An AQL block wrote too few output registers","An AQL block wrote too few output registers"
ERROR_WROTE_TOO_MANY_OUTPUT_REGISTERS,2202,"An AQL block wrote too many output registers","An AQL block wrote too many output registers"
ERROR_WROTE_OUTPUT_REGISTER_TWICE,2203,"An AQL block wrote an output register twice","An AQL block wrote an output register twice"
ERROR_WROTE_IN_WRONG_REGISTER,2204,"An AQL block wrote in a register that is not its output","An AQL block wrote in a register that is not its output"
ERROR_INPUT_REGISTERS_NOT_COPIED,2205,"An AQL block did not copy its input registers","An AQL block did not copy its input registers"
################################################################################
## Foxx management errors
################################################################################
ERROR_MALFORMED_MANIFEST_FILE,3000,"failed to parse manifest file","The service manifest file is not well-formed JSON."
ERROR_INVALID_SERVICE_MANIFEST,3001,"manifest file is invalid","The service manifest contains invalid values."
ERROR_SERVICE_FILES_MISSING,3002,"service files missing","The service folder or bundle does not exist on this server."
ERROR_SERVICE_FILES_OUTDATED,3003,"service files outdated","The local service bundle does not match the checksum in the database."
ERROR_INVALID_FOXX_OPTIONS,3004,"service options are invalid","The service options contain invalid values."
ERROR_INVALID_MOUNTPOINT,3007,"invalid mountpath","The service mountpath contains invalid characters."
ERROR_SERVICE_NOT_FOUND,3009,"service not found","No service found at the given mountpath."
ERROR_SERVICE_NEEDS_CONFIGURATION,3010,"service needs configuration","The service is missing configuration or dependencies."
ERROR_SERVICE_MOUNTPOINT_CONFLICT,3011,"service already exists","A service already exists at the given mountpath."
ERROR_SERVICE_MANIFEST_NOT_FOUND,3012,"missing manifest file","The service directory does not contain a manifest file."
ERROR_SERVICE_OPTIONS_MALFORMED,3013,"failed to parse service options","The service options are not well-formed JSON."
ERROR_SERVICE_SOURCE_NOT_FOUND,3014,"source path not found","The source path does not match a file or directory."
ERROR_SERVICE_SOURCE_ERROR,3015,"error resolving source","The source path could not be resolved."
ERROR_SERVICE_UNKNOWN_SCRIPT,3016,"unknown script","The service does not have a script with this name."
ERROR_SERVICE_API_DISABLED,3099,"service api disabled","The API for managing Foxx services has been disabled on this server."
################################################################################
## JavaScript module loader errors
################################################################################
ERROR_MODULE_NOT_FOUND,3100,"cannot locate module","The module path could not be resolved."
ERROR_MODULE_SYNTAX_ERROR,3101,"syntax error in module","The module could not be parsed because of a syntax error."
ERROR_MODULE_FAILURE,3103,"failed to invoke module","Failed to invoke the module in its context."
################################################################################
## Enterprise errors
################################################################################
ERROR_NO_SMART_COLLECTION,4000,"collection is not smart","The requested collection needs to be smart, but it ain't"
ERROR_NO_SMART_GRAPH_ATTRIBUTE,4001,"smart graph attribute not given","The given document does not have the smart graph attribute set."
ERROR_CANNOT_DROP_SMART_COLLECTION,4002,"cannot drop this smart collection","This smart collection cannot be dropped, it dictates sharding in the graph."
ERROR_KEY_MUST_BE_PREFIXED_WITH_SMART_GRAPH_ATTRIBUTE,4003,"in smart vertex collections _key must be prefixed with the value of the smart graph attribute","In a smart vertex collection _key must be prefixed with the value of the smart graph attribute."
ERROR_ILLEGAL_SMART_GRAPH_ATTRIBUTE,4004,"attribute cannot be used as smart graph attribute","The given smartGraph attribute is illegal and connot be used for sharding. All system attributes are forbidden."
ERROR_SMART_GRAPH_ATTRIBUTE_MISMATCH,4005,"smart graph attribute mismatch","The smart graph attribute of the given collection does not match the smart graph attribute of the graph."
ERROR_INVALID_SMART_JOIN_ATTRIBUTE,4006,"invalid smart join attribute declaration","Will be raised when the smartJoinAttribute declaration is invalid."
ERROR_KEY_MUST_BE_PREFIXED_WITH_SMART_JOIN_ATTRIBUTE,4007,"shard key value must be prefixed with the value of the smart join attribute","when using smartJoinAttribute for a collection, the shard key value must be prefixed with the value of the smart join attribute."
ERROR_NO_SMART_JOIN_ATTRIBUTE,4008,"smart join attribute not given or invalid","The given document does not have the required smart join attribute set or it has an invalid value."
ERROR_CLUSTER_MUST_NOT_CHANGE_SMART_JOIN_ATTRIBUTE,4009,"must not change the value of the smartJoinAttribute","Will be raised if there is an attempt to update the value of the smartJoinAttribute."
################################################################################
## Cluster repair errors
################################################################################
ERROR_CLUSTER_REPAIRS_FAILED,5000,"error during cluster repairs","General error during cluster repairs"
ERROR_CLUSTER_REPAIRS_NOT_ENOUGH_HEALTHY,5001,"not enough (healthy) db servers","Will be raised when, during repairDistributeShardsLike, there must be a free db server to move a shard, but there is no candidate or none is healthy."
ERROR_CLUSTER_REPAIRS_REPLICATION_FACTOR_VIOLATED,5002,"replication factor violated during cluster repairs","Will be raised on various inconsistencies regarding the replication factor"
ERROR_CLUSTER_REPAIRS_NO_DBSERVERS,5003,"no dbservers during cluster repairs","Will be raised if a collection that is fixed has some shard without DB Servers"
ERROR_CLUSTER_REPAIRS_MISMATCHING_LEADERS,5004,"mismatching leaders during cluster repairs","Will be raised if a shard in collection and its prototype in the corresponding distributeShardsLike collection have mismatching leaders (when they should already have been fixed)"
ERROR_CLUSTER_REPAIRS_MISMATCHING_FOLLOWERS,5005,"mismatching followers during cluster repairs","Will be raised if a shard in collection and its prototype in the corresponding distributeShardsLike collection don't have the same followers (when they should already have been adjusted)"
ERROR_CLUSTER_REPAIRS_INCONSISTENT_ATTRIBUTES,5006,"inconsistent attributes during cluster repairs","Will be raised if a collection that is fixed does (not) have distributeShardsLike when it is expected, or does (not) have repairingDistributeShardsLike when it is expected"
ERROR_CLUSTER_REPAIRS_MISMATCHING_SHARDS,5007,"mismatching shards during cluster repairs","Will be raised if in a collection and its distributeShardsLike prototype collection some shard and its prototype have an unequal number of DB Servers"
ERROR_CLUSTER_REPAIRS_JOB_FAILED,5008,"move shard job failed during cluster repairs","Will be raised if a move shard job in the agency failed during cluster repairs"
ERROR_CLUSTER_REPAIRS_JOB_DISAPPEARED,5009,"move shard job disappeared during cluster repairs","Will be raised if a move shard job in the agency cannot be found anymore before it finished"
ERROR_CLUSTER_REPAIRS_OPERATION_FAILED,5010,"agency transaction failed during cluster repairs","Will be raised if an agency transaction failed during either sending or executing it."
################################################################################
## Agency errors
################################################################################
ERROR_AGENCY_INFORM_MUST_BE_OBJECT,20011,"Inform message must be an object.","The inform message in the agency must be an object."
ERROR_AGENCY_INFORM_MUST_CONTAIN_TERM,20012,"Inform message must contain uint parameter 'term'","The inform message in the agency must contain a uint parameter 'term'."
ERROR_AGENCY_INFORM_MUST_CONTAIN_ID,20013,"Inform message must contain string parameter 'id'","The inform message in the agency must contain a string parameter 'id'."
ERROR_AGENCY_INFORM_MUST_CONTAIN_ACTIVE,20014,"Inform message must contain array 'active'","The inform message in the agency must contain an array 'active'."
ERROR_AGENCY_INFORM_MUST_CONTAIN_POOL,20015,"Inform message must contain object 'pool'","The inform message in the agency must contain an object 'pool'."
ERROR_AGENCY_INFORM_MUST_CONTAIN_MIN_PING,20016,"Inform message must contain object 'min ping'","The inform message in the agency must contain an object 'min ping'."
ERROR_AGENCY_INFORM_MUST_CONTAIN_MAX_PING,20017,"Inform message must contain object 'max ping'","The inform message in the agency must contain an object 'max ping'."
ERROR_AGENCY_INFORM_MUST_CONTAIN_TIMEOUT_MULT,20018,"Inform message must contain object 'timeoutMult'","The inform message in the agency must contain an object 'timeoutMult'."
ERROR_AGENCY_CANNOT_REBUILD_DBS,20021,"Cannot rebuild readDB and spearHead","Will be raised if the readDB or the spearHead cannot be rebuilt from the replicated log."
################################################################################
## Supervision errors
################################################################################
ERROR_SUPERVISION_GENERAL_FAILURE,20501,"general supervision failure","General supervision failure."
################################################################################
## Dispatcher errors
################################################################################
ERROR_QUEUE_FULL,21003,"named queue is full","Will be returned if a queue with this name is full."
################################################################################
## Maintenance errors
################################################################################
ERROR_ACTION_OPERATION_UNABORTABLE,6002,"this maintenance action cannot be stopped","This maintenance action cannot be stopped once it is started"
ERROR_ACTION_UNFINISHED,6003,"maintenance action still processing","This maintenance action is still processing"
ERROR_NO_SUCH_ACTION,6004,"no such maintenance action","No such maintenance action exists"
################################################################################
## Backup/Restore errors
################################################################################
ERROR_HOT_BACKUP_INTERNAL, 7001, "internal hot backup error", "Failed to create hot backup set"
ERROR_HOT_RESTORE_INTERNAL, 7002, "internal hot restore error", "Failed to restore to hot backup set"
ERROR_BACKUP_TOPOLOGY, 7003, "backup does not match this topology", "The hot backup set cannot be restored on non matching cluster topology"
ERROR_NO_SPACE_LEFT_ON_DEVICE, 7004, "no space left on device", "No space left on device"
ERROR_FAILED_TO_UPLOAD_BACKUP, 7005, "failed to upload hot backup set to remote target", "Failed to upload hot backup set to remote target"
ERROR_FAILED_TO_DOWNLOAD_BACKUP, 7006, "failed to download hot backup set from remote source", "Failed to downloadload hot backup set from remote source"
ERROR_NO_SUCH_HOT_BACKUP, 7007, "no such hot backup set can be found, "Cannot find a hot backup set with this Id"
ERROR_REMOTE_REPOSITORY_CONFIG_BAD, 7008, "remote hotback repository configuration error", "The configuration given for upload or download operation to/from remote hotback repositories is wrong."
ERROR_LOCAL_LOCK_FAILED, 7009, "some db servers cannot be reached for transaction locks", "Some of the db servers cannot be reached for transaction locks."
ERROR_LOCAL_LOCK_RETRY, 7010, "some db servers cannot be reached for transaction locks", "Some of the db servers cannot be reached for transaction locks."
ERROR_HOT_BACKUP_CONFLICT, 7011, "hot backup conflict", "Conflict of multiple hot backup processes."
ERROR_HOT_BACKUP_DBSERVERS_AWOL, 7012, "hot backup not all db servers reachable", "One or more db servers could not be reached for hot backup inquiry"
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-vertex-centric.md -->
@startDocuBlockInline ensureVertexCentricHashIndex
<div class="example-container" id="ensureVertexCentricHashIndex_container">
<a class="anchorjs-link " href="#ensureVertexCentricHashIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureVertexCentricHashIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.collection.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"_from"</span>, <span class="hljs-string">"type"</span> ] })
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_from"</span>,
<span class="hljs-string">"type"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"collection/74913"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382082016935938"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="ensureVertexCentricHashIndex_container_collapse" onclick="$('#ensureVertexCentricHashIndex_long').hide(); $('#ensureVertexCentricHashIndex_short').show(); window.location.hash='ensureVertexCentricHashIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureVertexCentricHashIndex_short" onclick="$('#ensureVertexCentricHashIndex_short').hide(); $('#ensureVertexCentricHashIndex_long').show();">
<pre>
arangosh&gt; db.collection.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"_from"</span>, <span class="hljs-string">"type"</span> ] })
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureVertexCentricHashIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_01
<div class="example-container" id="viewUsage_01_container">
<a class="anchorjs-link " href="#viewUsage_01_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_01_long">
<pre>
arangosh&gt; view = db._createView(<span class="hljs-string">"myView"</span>, <span class="hljs-string">"arangosearch"</span>, {});
[ArangoView <span class="hljs-number">88751</span>, <span class="hljs-string">"myView"</span> (type arangosearch)]
</pre>
</div>
</div>
@endDocuBlock viewUsage_01
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_02
<div class="example-container" id="viewUsage_02_container">
<a class="anchorjs-link " href="#viewUsage_02_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_02_long">
<pre>
arangosh&gt; view = db._view(<span class="hljs-string">"myView"</span>);
[ArangoView <span class="hljs-number">88751</span>, <span class="hljs-string">"myView"</span> (type arangosearch)]
</pre>
</div>
</div>
@endDocuBlock viewUsage_02
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_03
<div class="example-container" id="viewUsage_03_container">
<a class="anchorjs-link " href="#viewUsage_03_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_03_long" style="Display: none;">
<pre>
arangosh&gt; view.properties();
{
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"links"</span> : {
},
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>
}
</pre>
<div id="viewUsage_03_container_collapse" onclick="$('#viewUsage_03_long').hide(); $('#viewUsage_03_short').show(); window.location.hash='viewUsage_03_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewUsage_03_short" onclick="$('#viewUsage_03_short').hide(); $('#viewUsage_03_long').show();">
<pre>
arangosh&gt; view.properties();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewUsage_03
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_04
<div class="example-container" id="viewUsage_04_container">
<a class="anchorjs-link " href="#viewUsage_04_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_04_long" style="Display: none;">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">cleanupIntervalStep</span>: <span class="hljs-number">12</span>});
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
</pre>
<div id="viewUsage_04_container_collapse" onclick="$('#viewUsage_04_long').hide(); $('#viewUsage_04_short').show(); window.location.hash='viewUsage_04_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewUsage_04_short" onclick="$('#viewUsage_04_short').hide(); $('#viewUsage_04_long').show();">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">cleanupIntervalStep</span>: <span class="hljs-number">12</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewUsage_04
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_05
<div class="example-container" id="viewUsage_05_container">
<a class="anchorjs-link " href="#viewUsage_05_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_05_long" style="Display: none;">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">colA</span>: {<span class="hljs-attr">includeAllFields</span>: <span class="hljs-literal">true</span>}}});
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
<span class="hljs-string">"colA"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"identity"</span>
],
<span class="hljs-string">"fields"</span> : {
},
<span class="hljs-string">"includeAllFields"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"storeValues"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"trackListPositions"</span> : <span class="hljs-literal">false</span>
}
}
}
</pre>
<div id="viewUsage_05_container_collapse" onclick="$('#viewUsage_05_long').hide(); $('#viewUsage_05_short').show(); window.location.hash='viewUsage_05_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewUsage_05_short" onclick="$('#viewUsage_05_short').hide(); $('#viewUsage_05_long').show();">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">colA</span>: {<span class="hljs-attr">includeAllFields</span>: <span class="hljs-literal">true</span>}}});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewUsage_05
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_06
<div class="example-container" id="viewUsage_06_container">
<a class="anchorjs-link " href="#viewUsage_06_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_06_long" style="Display: none;">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">colB</span>: {<span class="hljs-attr">fields</span>: {<span class="hljs-attr">text</span>: {}}}}});
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
<span class="hljs-string">"colA"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"identity"</span>
],
<span class="hljs-string">"fields"</span> : {
},
<span class="hljs-string">"includeAllFields"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"storeValues"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"trackListPositions"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"colB"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"identity"</span>
],
<span class="hljs-string">"fields"</span> : {
<span class="hljs-string">"text"</span> : {
}
},
<span class="hljs-string">"includeAllFields"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"storeValues"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"trackListPositions"</span> : <span class="hljs-literal">false</span>
}
}
}
</pre>
<div id="viewUsage_06_container_collapse" onclick="$('#viewUsage_06_long').hide(); $('#viewUsage_06_short').show(); window.location.hash='viewUsage_06_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewUsage_06_short" onclick="$('#viewUsage_06_short').hide(); $('#viewUsage_06_long').show();">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">colB</span>: {<span class="hljs-attr">fields</span>: {<span class="hljs-attr">text</span>: {}}}}});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewUsage_06
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_07
<div class="example-container" id="viewUsage_07_container">
<a class="anchorjs-link " href="#viewUsage_07_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_07_long" style="Display: none;">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">colA</span>: <span class="hljs-literal">null</span>}});
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
<span class="hljs-string">"colB"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"identity"</span>
],
<span class="hljs-string">"fields"</span> : {
<span class="hljs-string">"text"</span> : {
}
},
<span class="hljs-string">"includeAllFields"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"storeValues"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"trackListPositions"</span> : <span class="hljs-literal">false</span>
}
}
}
</pre>
<div id="viewUsage_07_container_collapse" onclick="$('#viewUsage_07_long').hide(); $('#viewUsage_07_short').show(); window.location.hash='viewUsage_07_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewUsage_07_short" onclick="$('#viewUsage_07_short').hide(); $('#viewUsage_07_long').show();">
<pre>
arangosh&gt; view.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">colA</span>: <span class="hljs-literal">null</span>}});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewUsage_07
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views.md -->
@startDocuBlockInline viewUsage_08
<div class="example-container" id="viewUsage_08_container">
<a class="anchorjs-link " href="#viewUsage_08_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewUsage_08_long">
<pre>
arangosh&gt; db._dropView(<span class="hljs-string">"myView"</span>);
</pre>
</div>
</div>
@endDocuBlock viewUsage_08
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs.md -->
@startDocuBlockInline generalGraphCreateGraphHowTo1
<div class="example-container" id="generalGraphCreateGraphHowTo1_container">
<a class="anchorjs-link " href="#generalGraphCreateGraphHowTo1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphCreateGraphHowTo1_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>);
arangosh&gt; graph;
{[Graph]
}
</pre>
</div>
</div>
@endDocuBlock generalGraphCreateGraphHowTo1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs.md -->
@startDocuBlockInline generalGraphCreateGraphHowTo2
<div class="example-container" id="generalGraphCreateGraphHowTo2_container">
<a class="anchorjs-link " href="#generalGraphCreateGraphHowTo2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphCreateGraphHowTo2_long">
<pre>
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"shop"</span>);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"customer"</span>);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"pet"</span>);
arangosh&gt; graph;
{[Graph]
}
</pre>
</div>
</div>
@endDocuBlock generalGraphCreateGraphHowTo2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs.md -->
@startDocuBlockInline generalGraphCreateGraphHowTo3
<div class="example-container" id="generalGraphCreateGraphHowTo3_container">
<a class="anchorjs-link " href="#generalGraphCreateGraphHowTo3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphCreateGraphHowTo3_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> rel = graph_module._relation(<span class="hljs-string">"isCustomer"</span>, [<span class="hljs-string">"shop"</span>], [<span class="hljs-string">"customer"</span>]);
arangosh&gt; graph._extendEdgeDefinitions(rel);
arangosh&gt; graph;
{[Graph]
}
</pre>
</div>
</div>
@endDocuBlock generalGraphCreateGraphHowTo3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-databases-working-with.md -->
@startDocuBlockInline dbName
<div class="example-container" id="dbName_container">
<a class="anchorjs-link " href="#dbName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="dbName_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db._name();
_system
</pre>
</div>
</div>
@endDocuBlock dbName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-databases-working-with.md -->
@startDocuBlockInline dbId
<div class="example-container" id="dbId_container">
<a class="anchorjs-link " href="#dbId_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="dbId_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db._id();
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock dbId
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-databases-working-with.md -->
@startDocuBlockInline dbPath
<div class="example-container" id="dbPath_container">
<a class="anchorjs-link " href="#dbPath_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="dbPath_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db._path();
<span class="hljs-regexp">/tmp/</span>arangosh_JLhkMp/rocksdb-clusterOrNot/data
</pre>
</div>
</div>
@endDocuBlock dbPath
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-examples.md -->
@startDocuBlockInline shellUseDB
<div class="example-container" id="shellUseDB_container">
<a class="anchorjs-link " href="#shellUseDB_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="shellUseDB_long">
<pre>
arangosh&gt; db._createDatabase(<span class="hljs-string">"myapp"</span>);
<span class="hljs-literal">true</span>
arangosh&gt; db._useDatabase(<span class="hljs-string">"myapp"</span>);
<span class="hljs-literal">true</span>
arangosh&gt; db._useDatabase(<span class="hljs-string">"_system"</span>);
<span class="hljs-literal">true</span>
arangosh&gt; db._dropDatabase(<span class="hljs-string">"myapp"</span>);
<span class="hljs-literal">true</span>
</pre>
</div>
</div>
@endDocuBlock shellUseDB
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-database-methods.md -->
@startDocuBlockInline viewDatabaseGet
<div class="example-container" id="viewDatabaseGet_container">
<a class="anchorjs-link " href="#viewDatabaseGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDatabaseGet_long">
<pre>
arangosh&gt; view = db._view(<span class="hljs-string">"example"</span>);
........&gt; <span class="hljs-comment">// or, alternatively</span>
[ArangoView <span class="hljs-number">88703</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
arangosh&gt; view = db[<span class="hljs-string">"example"</span>]
[ArangoView <span class="hljs-number">88703</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
</pre>
</div>
</div>
@endDocuBlock viewDatabaseGet
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-database-methods.md -->
@startDocuBlockInline viewDatabaseNameKnown
<div class="example-container" id="viewDatabaseNameKnown_container">
<a class="anchorjs-link " href="#viewDatabaseNameKnown_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDatabaseNameKnown_long">
<pre>
arangosh&gt; db._view(<span class="hljs-string">"demoView"</span>);
[ArangoView <span class="hljs-number">112</span>, <span class="hljs-string">"demoView"</span> (type arangosearch)]
</pre>
</div>
</div>
@endDocuBlock viewDatabaseNameKnown
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-database-methods.md -->
@startDocuBlockInline viewDatabaseNameUnknown
<div class="example-container" id="viewDatabaseNameUnknown_container">
<a class="anchorjs-link " href="#viewDatabaseNameUnknown_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDatabaseNameUnknown_long">
<pre>
arangosh&gt; db._view(<span class="hljs-string">"unknown"</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock viewDatabaseNameUnknown
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-database-methods.md -->
@startDocuBlockInline viewDatabaseCreate
<div class="example-container" id="viewDatabaseCreate_container">
<a class="anchorjs-link " href="#viewDatabaseCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDatabaseCreate_long" style="Display: none;">
<pre>
arangosh&gt; v = db._createView(<span class="hljs-string">"example"</span>, <span class="hljs-string">"arangosearch"</span>);
[ArangoView <span class="hljs-number">88695</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
arangosh&gt; v.properties()
{
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"links"</span> : {
},
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>
}
arangosh&gt; db._dropView(<span class="hljs-string">"example"</span>)
</pre>
<div id="viewDatabaseCreate_container_collapse" onclick="$('#viewDatabaseCreate_long').hide(); $('#viewDatabaseCreate_short').show(); window.location.hash='viewDatabaseCreate_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewDatabaseCreate_short" onclick="$('#viewDatabaseCreate_short').hide(); $('#viewDatabaseCreate_long').show();">
<pre>
arangosh&gt; v = db._createView(<span class="hljs-string">"example"</span>, <span class="hljs-string">"arangosearch"</span>);
arangosh&gt; v.properties()
arangosh&gt; db._dropView(<span class="hljs-string">"example"</span>)
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewDatabaseCreate
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-database-methods.md -->
@startDocuBlockInline viewDatabaseList
<div class="example-container" id="viewDatabaseList_container">
<a class="anchorjs-link " href="#viewDatabaseList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDatabaseList_long">
<pre>
arangosh&gt; db._views();
[
[ArangoView <span class="hljs-number">112</span>, <span class="hljs-string">"demoView"</span> (type arangosearch)],
[ArangoView <span class="hljs-number">88706</span>, <span class="hljs-string">"exampleView"</span> (type arangosearch)]
]
</pre>
</div>
</div>
@endDocuBlock viewDatabaseList
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-database-methods.md -->
@startDocuBlockInline viewDatabaseDrop
<div class="example-container" id="viewDatabaseDrop_container">
<a class="anchorjs-link " href="#viewDatabaseDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDatabaseDrop_long">
<pre>
arangosh&gt; db._createView(<span class="hljs-string">"exampleView"</span>, <span class="hljs-string">"arangosearch"</span>);
[ArangoView <span class="hljs-number">88700</span>, <span class="hljs-string">"exampleView"</span> (type arangosearch)]
arangosh&gt; db._dropView(<span class="hljs-string">"exampleView"</span>);
arangosh&gt; db._view(<span class="hljs-string">"exampleView"</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock viewDatabaseDrop
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-ttl.md -->
@startDocuBlockInline ensureTtlIndex
<div class="example-container" id="ensureTtlIndex_container">
<a class="anchorjs-link " href="#ensureTtlIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureTtlIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"ttl"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"creationDate"</span> ], <span class="hljs-attr">expireAfter</span>: <span class="hljs-number">600</span> });
{
<span class="hljs-string">"expireAfter"</span> : <span class="hljs-number">600</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"creationDate"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/74567"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081959264256"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ttl"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">100</span>; ++i) { db.test.insert({ <span class="hljs-attr">creationDate</span>: <span class="hljs-built_in">Date</span>.now() / <span class="hljs-number">1000</span> }); }
</pre>
<div id="ensureTtlIndex_container_collapse" onclick="$('#ensureTtlIndex_long').hide(); $('#ensureTtlIndex_short').show(); window.location.hash='ensureTtlIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureTtlIndex_short" onclick="$('#ensureTtlIndex_short').hide(); $('#ensureTtlIndex_long').show();">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"ttl"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"creationDate"</span> ], <span class="hljs-attr">expireAfter</span>: <span class="hljs-number">600</span> });
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">100</span>; ++i) { db.test.insert({ <span class="hljs-attr">creationDate</span>: <span class="hljs-built_in">Date</span>.now() / <span class="hljs-number">1000</span> }); }
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureTtlIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-hash.md -->
@startDocuBlockInline ensureUniqueConstraint
<div class="example-container" id="ensureUniqueConstraint_container">
<a class="anchorjs-link " href="#ensureUniqueConstraint_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureUniqueConstraint_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b.c"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b.c"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/74778"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081983381504"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">1</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74782"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74782"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXK--_"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">1</span> } });
[ArangoError <span class="hljs-number">1210</span>: unique constraint violated - <span class="hljs-keyword">in</span> index idx_1646382081983381504 <span class="hljs-keyword">of</span> type hash over <span class="hljs-string">'a, b.c'</span>; conflicting key: <span class="hljs-number">74782</span>]
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-literal">null</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74786"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74786"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXO---"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
[ArangoError <span class="hljs-number">1210</span>: unique constraint violated - <span class="hljs-keyword">in</span> index idx_1646382081983381504 <span class="hljs-keyword">of</span> type hash over <span class="hljs-string">'a, b.c'</span>; conflicting key: <span class="hljs-number">74786</span>]
</pre>
<div id="ensureUniqueConstraint_container_collapse" onclick="$('#ensureUniqueConstraint_long').hide(); $('#ensureUniqueConstraint_short').show(); window.location.hash='ensureUniqueConstraint_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureUniqueConstraint_short" onclick="$('#ensureUniqueConstraint_short').hide(); $('#ensureUniqueConstraint_long').show();">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b.c"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">1</span> } });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">1</span> } });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-literal">null</span> } });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureUniqueConstraint
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-hash.md -->
@startDocuBlockInline ensureHashIndex
<div class="example-container" id="ensureHashIndex_container">
<a class="anchorjs-link " href="#ensureHashIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureHashIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/74474"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081936195584"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74478"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74478"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dUW--_"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74480"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74480"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dUa---"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-literal">null</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74482"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74482"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dUa--A"</span>
}
</pre>
<div id="ensureHashIndex_container_collapse" onclick="$('#ensureHashIndex_long').hide(); $('#ensureHashIndex_short').show(); window.location.hash='ensureHashIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureHashIndex_short" onclick="$('#ensureHashIndex_short').hide(); $('#ensureHashIndex_long').show();">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-literal">null</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureHashIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-hash.md -->
@startDocuBlockInline ensureHashIndexArray
<div class="example-container" id="ensureHashIndexArray_container">
<a class="anchorjs-link " href="#ensureHashIndexArray_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureHashIndexArray_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a[*]"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a[*]"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/74491"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081940389888"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ] });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74495"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74495"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dUm--_"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">3</span> ] });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74497"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74497"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dUq---"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-literal">null</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74499"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74499"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dUq--A"</span>
}
</pre>
<div id="ensureHashIndexArray_container_collapse" onclick="$('#ensureHashIndexArray_long').hide(); $('#ensureHashIndexArray_short').show(); window.location.hash='ensureHashIndexArray_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureHashIndexArray_short" onclick="$('#ensureHashIndexArray_short').hide(); $('#ensureHashIndexArray_long').show();">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a[*]"</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">3</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-literal">null</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureHashIndexArray
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-wal.md -->
@startDocuBlockInline WalPropertiesGet
<div class="example-container" id="WalPropertiesGet_container">
<a class="anchorjs-link " href="#WalPropertiesGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="WalPropertiesGet_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"internal"</span>).wal.properties();
{
}
</pre>
</div>
</div>
@endDocuBlock WalPropertiesGet
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-wal.md -->
@startDocuBlockInline WalPropertiesSet
<div class="example-container" id="WalPropertiesSet_container">
<a class="anchorjs-link " href="#WalPropertiesSet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="WalPropertiesSet_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"internal"</span>).wal.properties({
........&gt; allowOverSizeEntries: <span class="hljs-literal">true</span>,
........&gt; logfileSize: <span class="hljs-number">32</span> * <span class="hljs-number">1024</span> * <span class="hljs-number">1024</span> });
{
}
</pre>
</div>
</div>
@endDocuBlock WalPropertiesSet
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-wal.md -->
@startDocuBlockInline WalFlush
<div class="example-container" id="WalFlush_container">
<a class="anchorjs-link " href="#WalFlush_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="WalFlush_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"internal"</span>).wal.flush();
</pre>
</div>
</div>
@endDocuBlock WalFlush
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-fulltext.md -->
@startDocuBlockInline ensureFulltextIndex
<div class="example-container" id="ensureFulltextIndex_container">
<a class="anchorjs-link " href="#ensureFulltextIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureFulltextIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"fulltext"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"text"</span> ], <span class="hljs-attr">minLength</span>: <span class="hljs-number">3</span> });
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"text"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/74448"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"minLength"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081927806976"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"fulltext"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"the quick brown"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">1</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74452"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74452"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT2--_"</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"quick brown fox"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">2</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74454"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74454"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT6---"</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"brown fox jums"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">3</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74456"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74456"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT6--A"</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"fox jumps over"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">4</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74458"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74458"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT6--C"</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"jumps over the"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">5</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74460"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74460"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT6--E"</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"over the lazy"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">6</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74462"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74462"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU----"</span>
}
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"the lazy dog"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">7</span> } });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74464"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74464"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU---A"</span>
}
arangosh&gt; db._query(<span class="hljs-string">"FOR document IN FULLTEXT(example, 'text', 'the') RETURN document"</span>);
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74452"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74452"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT2--_"</span>,
<span class="hljs-string">"text"</span> : <span class="hljs-string">"the quick brown"</span>,
<span class="hljs-string">"b"</span> : {
<span class="hljs-string">"c"</span> : <span class="hljs-number">1</span>
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74460"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74460"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT6--E"</span>,
<span class="hljs-string">"text"</span> : <span class="hljs-string">"jumps over the"</span>,
<span class="hljs-string">"b"</span> : {
<span class="hljs-string">"c"</span> : <span class="hljs-number">5</span>
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74462"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74462"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU----"</span>,
<span class="hljs-string">"text"</span> : <span class="hljs-string">"over the lazy"</span>,
<span class="hljs-string">"b"</span> : {
<span class="hljs-string">"c"</span> : <span class="hljs-number">6</span>
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74464"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74464"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU---A"</span>,
<span class="hljs-string">"text"</span> : <span class="hljs-string">"the lazy dog"</span>,
<span class="hljs-string">"b"</span> : {
<span class="hljs-string">"c"</span> : <span class="hljs-number">7</span>
}
}
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">4</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="ensureFulltextIndex_container_collapse" onclick="$('#ensureFulltextIndex_long').hide(); $('#ensureFulltextIndex_short').show(); window.location.hash='ensureFulltextIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureFulltextIndex_short" onclick="$('#ensureFulltextIndex_short').hide(); $('#ensureFulltextIndex_long').show();">
<pre>
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"fulltext"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"text"</span> ], <span class="hljs-attr">minLength</span>: <span class="hljs-number">3</span> });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"the quick brown"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">1</span> } });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"quick brown fox"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">2</span> } });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"brown fox jums"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">3</span> } });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"fox jumps over"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">4</span> } });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"jumps over the"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">5</span> } });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"over the lazy"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">6</span> } });
arangosh&gt; db.example.save({ <span class="hljs-attr">text</span> : <span class="hljs-string">"the lazy dog"</span>, <span class="hljs-attr">b</span> : { <span class="hljs-attr">c</span> : <span class="hljs-number">7</span> } });
arangosh&gt; db._query(<span class="hljs-string">"FOR document IN FULLTEXT(example, 'text', 'the') RETURN document"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureFulltextIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 001_collectionAll
<div class="example-container" id="001_collectionAll_container">
<a class="anchorjs-link " href="#001_collectionAll_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="001_collectionAll_long" style="Display: none;">
<pre>
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"one"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/120"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"120"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oSu--A"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"two"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/122"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"122"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS2---"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"three"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/124"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"124"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS2--A"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"four"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/126"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"126"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS6---"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"five"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/128"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"128"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS6--A"</span>
}
arangosh&gt; db.five.all().toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"120"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/120"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oSu--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"122"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/122"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"two"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"124"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/124"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"three"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"126"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/126"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"four"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"128"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/128"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oS6--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"five"</span>
}
]
</pre>
<div id="001_collectionAll_container_collapse" onclick="$('#001_collectionAll_long').hide(); $('#001_collectionAll_short').show(); window.location.hash='001_collectionAll_container';" class="example_show_button">Hide execution results</div></div>
<div id="001_collectionAll_short" onclick="$('#001_collectionAll_short').hide(); $('#001_collectionAll_long').show();">
<pre>
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"one"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"two"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"three"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"four"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"five"</span> });
arangosh&gt; db.five.all().toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 001_collectionAll
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 002_collectionAllNext
<div class="example-container" id="002_collectionAllNext_container">
<a class="anchorjs-link " href="#002_collectionAllNext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="002_collectionAllNext_long" style="Display: none;">
<pre>
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"one"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/139"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"139"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oU----"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"two"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/141"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"141"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oU---A"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"three"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/143"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"143"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oU---C"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"four"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/145"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"145"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUC---"</span>
}
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"five"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/147"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"147"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUC--A"</span>
}
arangosh&gt; db.five.all().limit(<span class="hljs-number">2</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"139"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/139"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oU----"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"141"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/141"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oU---A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"two"</span>
}
]
</pre>
<div id="002_collectionAllNext_container_collapse" onclick="$('#002_collectionAllNext_long').hide(); $('#002_collectionAllNext_short').show(); window.location.hash='002_collectionAllNext_container';" class="example_show_button">Hide execution results</div></div>
<div id="002_collectionAllNext_short" onclick="$('#002_collectionAllNext_short').hide(); $('#002_collectionAllNext_long').show();">
<pre>
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"one"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"two"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"three"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"four"</span> });
arangosh&gt; db.five.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"five"</span> });
arangosh&gt; db.five.all().limit(<span class="hljs-number">2</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 002_collectionAllNext
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 003_collectionByExample
<div class="example-container" id="003_collectionByExample_container">
<a class="anchorjs-link " href="#003_collectionByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="003_collectionByExample_long" style="Display: none;">
<pre>
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Gerhard"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/158"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"158"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe---"</span>
}
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Helmut"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/160"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"160"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe--A"</span>
}
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Angela"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/162"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"162"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe--C"</span>
}
arangosh&gt; db.users.all().toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"158"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/158"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"160"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/160"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Helmut"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"162"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/162"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span>
}
]
arangosh&gt; db.users.byExample({ <span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/20"</span> }).toArray();
[ ]
arangosh&gt; db.users.byExample({ <span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span> }).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"158"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/158"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oUe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span>
}
]
arangosh&gt; db.users.byExample({ <span class="hljs-string">"name"</span> : <span class="hljs-string">"Helmut"</span>, <span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/15"</span> }).toArray();
[ ]
</pre>
<div id="003_collectionByExample_container_collapse" onclick="$('#003_collectionByExample_long').hide(); $('#003_collectionByExample_short').show(); window.location.hash='003_collectionByExample_container';" class="example_show_button">Hide execution results</div></div>
<div id="003_collectionByExample_short" onclick="$('#003_collectionByExample_short').hide(); $('#003_collectionByExample_long').show();">
<pre>
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Gerhard"</span> });
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Helmut"</span> });
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Angela"</span> });
arangosh&gt; db.users.all().toArray();
arangosh&gt; db.users.byExample({ <span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/20"</span> }).toArray();
arangosh&gt; db.users.byExample({ <span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span> }).toArray();
arangosh&gt; db.users.byExample({ <span class="hljs-string">"name"</span> : <span class="hljs-string">"Helmut"</span>, <span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/15"</span> }).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 003_collectionByExample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 004_collectionByExampleNext
<div class="example-container" id="004_collectionByExampleNext_container">
<a class="anchorjs-link " href="#004_collectionByExampleNext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="004_collectionByExampleNext_long" style="Display: none;">
<pre>
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Gerhard"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/176"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"176"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVG---"</span>
}
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Helmut"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/178"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"178"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVG--A"</span>
}
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Angela"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/180"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"180"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVG--C"</span>
}
arangosh&gt; <span class="hljs-keyword">var</span> a = db.users.byExample( {<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span> } );
arangosh&gt; <span class="hljs-keyword">while</span> (a.hasNext()) print(a.next());
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"180"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/180"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span>
}
</pre>
<div id="004_collectionByExampleNext_container_collapse" onclick="$('#004_collectionByExampleNext_long').hide(); $('#004_collectionByExampleNext_short').show(); window.location.hash='004_collectionByExampleNext_container';" class="example_show_button">Hide execution results</div></div>
<div id="004_collectionByExampleNext_short" onclick="$('#004_collectionByExampleNext_short').hide(); $('#004_collectionByExampleNext_long').show();">
<pre>
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Gerhard"</span> });
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Helmut"</span> });
arangosh&gt; db.users.insert({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Angela"</span> });
arangosh&gt; <span class="hljs-keyword">var</span> a = db.users.byExample( {<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span> } );
arangosh&gt; <span class="hljs-keyword">while</span> (a.hasNext()) print(a.next());
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 004_collectionByExampleNext
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline collectionFirstExample
<div class="example-container" id="collectionFirstExample_container">
<a class="anchorjs-link " href="#collectionFirstExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionFirstExample_long" style="Display: none;">
<pre>
arangosh&gt; db.users.firstExample(<span class="hljs-string">"name"</span>, <span class="hljs-string">"Angela"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73845"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/73845"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dE---C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span>
}
</pre>
<div id="collectionFirstExample_container_collapse" onclick="$('#collectionFirstExample_long').hide(); $('#collectionFirstExample_short').show(); window.location.hash='collectionFirstExample_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionFirstExample_short" onclick="$('#collectionFirstExample_short').hide(); $('#collectionFirstExample_long').show();">
<pre>
arangosh&gt; db.users.firstExample(<span class="hljs-string">"name"</span>, <span class="hljs-string">"Angela"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionFirstExample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 005_collectionRange
<div class="example-container" id="005_collectionRange_container">
<a class="anchorjs-link " href="#005_collectionRange_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="005_collectionRange_long" style="Display: none;">
<pre>
arangosh&gt; db.old.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"age"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"age"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"old/190"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382025045704705"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">15</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/194"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"194"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVe---"</span>
}
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/196"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"196"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVe--A"</span>
}
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">30</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/198"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"198"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVe--C"</span>
}
arangosh&gt; db.old.range(<span class="hljs-string">"age"</span>, <span class="hljs-number">10</span>, <span class="hljs-number">30</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"194"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/194"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVe---"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">15</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"196"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/196"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oVe--A"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">25</span>
}
]
</pre>
<div id="005_collectionRange_container_collapse" onclick="$('#005_collectionRange_long').hide(); $('#005_collectionRange_short').show(); window.location.hash='005_collectionRange_container';" class="example_show_button">Hide execution results</div></div>
<div id="005_collectionRange_short" onclick="$('#005_collectionRange_short').hide(); $('#005_collectionRange_long').show();">
<pre>
arangosh&gt; db.old.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"age"</span> ] });
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">15</span> });
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> });
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">30</span> });
arangosh&gt; db.old.range(<span class="hljs-string">"age"</span>, <span class="hljs-number">10</span>, <span class="hljs-number">30</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 005_collectionRange
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 006_collectionClosedRange
<div class="example-container" id="006_collectionClosedRange_container">
<a class="anchorjs-link " href="#006_collectionClosedRange_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="006_collectionClosedRange_long" style="Display: none;">
<pre>
arangosh&gt; db.old.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"age"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"age"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"old/209"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382025055141890"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">15</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/213"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"213"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oWC---"</span>
}
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/215"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"215"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oWC--A"</span>
}
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">30</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/217"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"217"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oWC--C"</span>
}
arangosh&gt; db.old.closedRange(<span class="hljs-string">"age"</span>, <span class="hljs-number">10</span>, <span class="hljs-number">30</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"213"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/213"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oWC---"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">15</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"215"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/215"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oWC--A"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">25</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"217"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"old/217"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oWC--C"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">30</span>
}
]
</pre>
<div id="006_collectionClosedRange_container_collapse" onclick="$('#006_collectionClosedRange_long').hide(); $('#006_collectionClosedRange_short').show(); window.location.hash='006_collectionClosedRange_container';" class="example_show_button">Hide execution results</div></div>
<div id="006_collectionClosedRange_short" onclick="$('#006_collectionClosedRange_short').hide(); $('#006_collectionClosedRange_long').show();">
<pre>
arangosh&gt; db.old.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"age"</span> ] });
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">15</span> });
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">25</span> });
arangosh&gt; db.old.insert({ <span class="hljs-attr">age</span>: <span class="hljs-number">30</span> });
arangosh&gt; db.old.closedRange(<span class="hljs-string">"age"</span>, <span class="hljs-number">10</span>, <span class="hljs-number">30</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 006_collectionClosedRange
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline collectionCount
<div class="example-container" id="collectionCount_container">
<a class="anchorjs-link " href="#collectionCount_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionCount_long">
<pre>
arangosh&gt; db.users.count();
<span class="hljs-number">0</span>
</pre>
</div>
</div>
@endDocuBlock collectionCount
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionNameValidPlain
<div class="example-container" id="documentsCollectionNameValidPlain_container">
<a class="anchorjs-link " href="#documentsCollectionNameValidPlain_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionNameValidPlain_long" style="Display: none;">
<pre>
arangosh&gt; db.example.document(<span class="hljs-string">"example/2873916"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2873916"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/2873916"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPW--A"</span>
}
</pre>
<div id="documentsCollectionNameValidPlain_container_collapse" onclick="$('#documentsCollectionNameValidPlain_long').hide(); $('#documentsCollectionNameValidPlain_short').show(); window.location.hash='documentsCollectionNameValidPlain_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionNameValidPlain_short" onclick="$('#documentsCollectionNameValidPlain_short').hide(); $('#documentsCollectionNameValidPlain_long').show();">
<pre>
arangosh&gt; db.example.document(<span class="hljs-string">"example/2873916"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionNameValidPlain
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionNameValidByKey
<div class="example-container" id="documentsCollectionNameValidByKey_container">
<a class="anchorjs-link " href="#documentsCollectionNameValidByKey_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionNameValidByKey_long" style="Display: none;">
<pre>
arangosh&gt; db.example.document(<span class="hljs-string">"2873916"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2873916"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/2873916"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dO2--A"</span>
}
</pre>
<div id="documentsCollectionNameValidByKey_container_collapse" onclick="$('#documentsCollectionNameValidByKey_long').hide(); $('#documentsCollectionNameValidByKey_short').show(); window.location.hash='documentsCollectionNameValidByKey_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionNameValidByKey_short" onclick="$('#documentsCollectionNameValidByKey_short').hide(); $('#documentsCollectionNameValidByKey_long').show();">
<pre>
arangosh&gt; db.example.document(<span class="hljs-string">"2873916"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionNameValidByKey
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionNameValidByObject
<div class="example-container" id="documentsCollectionNameValidByObject_container">
<a class="anchorjs-link " href="#documentsCollectionNameValidByObject_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionNameValidByObject_long" style="Display: none;">
<pre>
arangosh&gt; db.example.document({<span class="hljs-attr">_id</span>: <span class="hljs-string">"example/2873916"</span>});
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2873916"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/2873916"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPC---"</span>
}
</pre>
<div id="documentsCollectionNameValidByObject_container_collapse" onclick="$('#documentsCollectionNameValidByObject_long').hide(); $('#documentsCollectionNameValidByObject_short').show(); window.location.hash='documentsCollectionNameValidByObject_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionNameValidByObject_short" onclick="$('#documentsCollectionNameValidByObject_short').hide(); $('#documentsCollectionNameValidByObject_long').show();">
<pre>
arangosh&gt; db.example.document({<span class="hljs-attr">_id</span>: <span class="hljs-string">"example/2873916"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionNameValidByObject
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionNameValidMulti
<div class="example-container" id="documentsCollectionNameValidMulti_container">
<a class="anchorjs-link " href="#documentsCollectionNameValidMulti_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionNameValidMulti_long" style="Display: none;">
<pre>
arangosh&gt; db.example.document([<span class="hljs-string">"2873916"</span>,<span class="hljs-string">"2873917"</span>]);
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2873916"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/2873916"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPK--A"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2873917"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/2873917"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPK--C"</span>
}
]
</pre>
<div id="documentsCollectionNameValidMulti_container_collapse" onclick="$('#documentsCollectionNameValidMulti_long').hide(); $('#documentsCollectionNameValidMulti_short').show(); window.location.hash='documentsCollectionNameValidMulti_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionNameValidMulti_short" onclick="$('#documentsCollectionNameValidMulti_short').hide(); $('#documentsCollectionNameValidMulti_long').show();">
<pre>
arangosh&gt; db.example.document([<span class="hljs-string">"2873916"</span>,<span class="hljs-string">"2873917"</span>]);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionNameValidMulti
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionNameUnknown
<div class="example-container" id="documentsCollectionNameUnknown_container">
<a class="anchorjs-link " href="#documentsCollectionNameUnknown_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionNameUnknown_long">
<pre>
arangosh&gt; db.example.document(<span class="hljs-string">"example/4472917"</span>);
[ArangoError <span class="hljs-number">1202</span>: <span class="hljs-built_in">document</span> not found]
</pre>
</div>
</div>
@endDocuBlock documentsCollectionNameUnknown
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionNameHandle
<div class="example-container" id="documentsCollectionNameHandle_container">
<a class="anchorjs-link " href="#documentsCollectionNameHandle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionNameHandle_long">
<pre>
arangosh&gt; db.example.document(<span class="hljs-string">""</span>);
[ArangoError <span class="hljs-number">1205</span>: illegal <span class="hljs-built_in">document</span> handle]
</pre>
</div>
</div>
@endDocuBlock documentsCollectionNameHandle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline collectionLookupByKeys
<div class="example-container" id="collectionLookupByKeys_container">
<a class="anchorjs-link " href="#collectionLookupByKeys_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionLookupByKeys_long" style="Display: none;">
<pre>
arangosh&gt; keys = [ ];
[ ]
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; ++i) {
........&gt; db.example.insert({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"test"</span> + i, <span class="hljs-attr">value</span>: i });
........&gt; keys.push(<span class="hljs-string">"test"</span> + i);
........&gt; }
arangosh&gt; db.example.documents(keys);
{
<span class="hljs-string">"documents"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test0"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test0"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFG--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test1"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test1"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFK---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test2"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test2"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFK--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test3"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test3"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFK--C"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test4"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test4"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFK--E"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">4</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test5"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test5"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFO---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test6"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test6"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFO--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">6</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test7"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test7"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFO--C"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">7</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test8"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test8"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFO--E"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">8</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test9"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/test9"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dFO--G"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">9</span>
}
]
}
</pre>
<div id="collectionLookupByKeys_container_collapse" onclick="$('#collectionLookupByKeys_long').hide(); $('#collectionLookupByKeys_short').show(); window.location.hash='collectionLookupByKeys_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionLookupByKeys_short" onclick="$('#collectionLookupByKeys_short').hide(); $('#collectionLookupByKeys_long').show();">
<pre>
arangosh&gt; keys = [ ];
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; ++i) {
........&gt; db.example.insert({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"test"</span> + i, <span class="hljs-attr">value</span>: i });
........&gt; keys.push(<span class="hljs-string">"test"</span> + i);
........&gt; }
arangosh&gt; db.example.documents(keys);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionLookupByKeys
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionInsertSingle
<div class="example-container" id="documentsCollectionInsertSingle_container">
<a class="anchorjs-link " href="#documentsCollectionInsertSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionInsertSingle_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74152"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74152"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNu--A"</span>
}
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> }, {<span class="hljs-attr">waitForSync</span>: <span class="hljs-literal">true</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74154"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74154"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNu--C"</span>
}
</pre>
<div id="documentsCollectionInsertSingle_container_collapse" onclick="$('#documentsCollectionInsertSingle_long').hide(); $('#documentsCollectionInsertSingle_short').show(); window.location.hash='documentsCollectionInsertSingle_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionInsertSingle_short" onclick="$('#documentsCollectionInsertSingle_short').hide(); $('#documentsCollectionInsertSingle_long').show();">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> });
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> }, {<span class="hljs-attr">waitForSync</span>: <span class="hljs-literal">true</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionInsertSingle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionInsertMulti
<div class="example-container" id="documentsCollectionInsertMulti_container">
<a class="anchorjs-link " href="#documentsCollectionInsertMulti_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionInsertMulti_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert([{ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> }, {<span class="hljs-attr">Hello</span>: <span class="hljs-string">"there"</span>}])
[
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74139"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74139"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNa--A"</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74140"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74140"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNa--C"</span>
}
]
arangosh&gt; db.example.insert([{ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> }, {}], {<span class="hljs-attr">waitForSync</span>: <span class="hljs-literal">true</span>});
[
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74142"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74142"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNe---"</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74143"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74143"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNe--A"</span>
}
]
</pre>
<div id="documentsCollectionInsertMulti_container_collapse" onclick="$('#documentsCollectionInsertMulti_long').hide(); $('#documentsCollectionInsertMulti_short').show(); window.location.hash='documentsCollectionInsertMulti_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionInsertMulti_short" onclick="$('#documentsCollectionInsertMulti_short').hide(); $('#documentsCollectionInsertMulti_long').show();">
<pre>
arangosh&gt; db.example.insert([{ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> }, {<span class="hljs-attr">Hello</span>: <span class="hljs-string">"there"</span>}])
arangosh&gt; db.example.insert([{ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> }, {}], {<span class="hljs-attr">waitForSync</span>: <span class="hljs-literal">true</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionInsertMulti
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionInsertSingleOverwrite
<div class="example-container" id="documentsCollectionInsertSingleOverwrite_container">
<a class="anchorjs-link " href="#documentsCollectionInsertSingleOverwrite_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionInsertSingleOverwrite_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">_key</span> : <span class="hljs-string">"666"</span>, <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/666"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"666"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dOO--A"</span>
}
arangosh&gt; db.example.insert({ <span class="hljs-attr">_key</span> : <span class="hljs-string">"666"</span>, <span class="hljs-attr">Hello</span> : <span class="hljs-string">"Universe"</span> }, {<span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">returnOld</span>: <span class="hljs-literal">true</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/666"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"666"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dOS--A"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dOO--A"</span>,
<span class="hljs-string">"old"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"666"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/666"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dOO--A"</span>,
<span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span>
}
}
</pre>
<div id="documentsCollectionInsertSingleOverwrite_container_collapse" onclick="$('#documentsCollectionInsertSingleOverwrite_long').hide(); $('#documentsCollectionInsertSingleOverwrite_short').show(); window.location.hash='documentsCollectionInsertSingleOverwrite_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionInsertSingleOverwrite_short" onclick="$('#documentsCollectionInsertSingleOverwrite_short').hide(); $('#documentsCollectionInsertSingleOverwrite_long').show();">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">_key</span> : <span class="hljs-string">"666"</span>, <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> });
arangosh&gt; db.example.insert({ <span class="hljs-attr">_key</span> : <span class="hljs-string">"666"</span>, <span class="hljs-attr">Hello</span> : <span class="hljs-string">"Universe"</span> }, {<span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">returnOld</span>: <span class="hljs-literal">true</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionInsertSingleOverwrite
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionReplace1
<div class="example-container" id="documentsCollectionReplace1_container">
<a class="anchorjs-link " href="#documentsCollectionReplace1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionReplace1_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74279"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74279"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dQW--A"</span>
}
arangosh&gt; a2 = db.example.replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74279"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74279"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dQW--D"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dQW--A"</span>
}
arangosh&gt; a3 = db.example.replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">3</span> });
[ArangoError <span class="hljs-number">1200</span>: precondition failed]
</pre>
<div id="documentsCollectionReplace1_container_collapse" onclick="$('#documentsCollectionReplace1_long').hide(); $('#documentsCollectionReplace1_short').show(); window.location.hash='documentsCollectionReplace1_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionReplace1_short" onclick="$('#documentsCollectionReplace1_short').hide(); $('#documentsCollectionReplace1_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; a2 = db.example.replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
arangosh&gt; a3 = db.example.replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">3</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionReplace1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollectionReplaceHandle
<div class="example-container" id="documentsCollectionReplaceHandle_container">
<a class="anchorjs-link " href="#documentsCollectionReplaceHandle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionReplaceHandle_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/3903045"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3903045"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dQi--C"</span>
}
arangosh&gt; a2 = db.example.replace(<span class="hljs-string">"example/3903044"</span>, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/3903044"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3903044"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dQm--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dQi--A"</span>
}
</pre>
<div id="documentsCollectionReplaceHandle_container_collapse" onclick="$('#documentsCollectionReplaceHandle_long').hide(); $('#documentsCollectionReplaceHandle_short').show(); window.location.hash='documentsCollectionReplaceHandle_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionReplaceHandle_short" onclick="$('#documentsCollectionReplaceHandle_short').hide(); $('#documentsCollectionReplaceHandle_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; a2 = db.example.replace(<span class="hljs-string">"example/3903044"</span>, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionReplaceHandle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollection_UpdateDocument
<div class="example-container" id="documentsCollection_UpdateDocument_container">
<a class="anchorjs-link " href="#documentsCollection_UpdateDocument_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollection_UpdateDocument_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74357"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74357"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dS---A"</span>
}
arangosh&gt; a2 = db.example.update(a1, {<span class="hljs-string">"b"</span> : <span class="hljs-number">2</span>, <span class="hljs-string">"c"</span> : <span class="hljs-number">3</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74357"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74357"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSC--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dS---A"</span>
}
arangosh&gt; a3 = db.example.update(a1, {<span class="hljs-string">"d"</span> : <span class="hljs-number">4</span>});
[ArangoError <span class="hljs-number">1200</span>: precondition failed]
arangosh&gt; a4 = db.example.update(a2, {<span class="hljs-string">"e"</span> : <span class="hljs-number">5</span>, <span class="hljs-string">"f"</span> : <span class="hljs-number">6</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74357"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74357"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSC--B"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSC--_"</span>
}
arangosh&gt; db.example.document(a4);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74357"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74357"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSC--B"</span>,
<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"c"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"b"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"f"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"e"</span> : <span class="hljs-number">5</span>
}
arangosh&gt; a5 = db.example.update(a4, {<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">c</span> : <span class="hljs-number">9</span>, <span class="hljs-attr">e</span> : <span class="hljs-number">42</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74357"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74357"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSG--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSC--B"</span>
}
arangosh&gt; db.example.document(a5);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74357"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74357"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSG--_"</span>,
<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"c"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"b"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"f"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"e"</span> : <span class="hljs-number">42</span>
}
</pre>
<div id="documentsCollection_UpdateDocument_container_collapse" onclick="$('#documentsCollection_UpdateDocument_long').hide(); $('#documentsCollection_UpdateDocument_short').show(); window.location.hash='documentsCollection_UpdateDocument_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollection_UpdateDocument_short" onclick="$('#documentsCollection_UpdateDocument_short').hide(); $('#documentsCollection_UpdateDocument_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>});
arangosh&gt; a2 = db.example.update(a1, {<span class="hljs-string">"b"</span> : <span class="hljs-number">2</span>, <span class="hljs-string">"c"</span> : <span class="hljs-number">3</span>});
arangosh&gt; a3 = db.example.update(a1, {<span class="hljs-string">"d"</span> : <span class="hljs-number">4</span>});
arangosh&gt; a4 = db.example.update(a2, {<span class="hljs-string">"e"</span> : <span class="hljs-number">5</span>, <span class="hljs-string">"f"</span> : <span class="hljs-number">6</span> });
arangosh&gt; db.example.document(a4);
arangosh&gt; a5 = db.example.update(a4, {<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">c</span> : <span class="hljs-number">9</span>, <span class="hljs-attr">e</span> : <span class="hljs-number">42</span> });
arangosh&gt; db.example.document(a5);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollection_UpdateDocument
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollection_UpdateHandleSingle
<div class="example-container" id="documentsCollection_UpdateHandleSingle_container">
<a class="anchorjs-link " href="#documentsCollection_UpdateHandleSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollection_UpdateHandleSingle_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/18612116"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"18612116"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dT---C"</span>
}
arangosh&gt; a2 = db.example.update(<span class="hljs-string">"example/18612115"</span>, { <span class="hljs-string">"x"</span> : <span class="hljs-number">1</span>, <span class="hljs-string">"y"</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/18612115"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"18612115"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dTC--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dT---A"</span>
}
</pre>
<div id="documentsCollection_UpdateHandleSingle_container_collapse" onclick="$('#documentsCollection_UpdateHandleSingle_long').hide(); $('#documentsCollection_UpdateHandleSingle_short').show(); window.location.hash='documentsCollection_UpdateHandleSingle_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollection_UpdateHandleSingle_short" onclick="$('#documentsCollection_UpdateHandleSingle_short').hide(); $('#documentsCollection_UpdateHandleSingle_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>});
arangosh&gt; a2 = db.example.update(<span class="hljs-string">"example/18612115"</span>, { <span class="hljs-string">"x"</span> : <span class="hljs-number">1</span>, <span class="hljs-string">"y"</span> : <span class="hljs-number">2</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollection_UpdateHandleSingle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollection_UpdateHandleKeepNull
<div class="example-container" id="documentsCollection_UpdateHandleKeepNull_container">
<a class="anchorjs-link " href="#documentsCollection_UpdateHandleKeepNull_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollection_UpdateHandleKeepNull_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988372"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988372"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSq--A"</span>
}
arangosh&gt; db.example.update(<span class="hljs-string">"example/19988371"</span>,
........&gt; { <span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span>, <span class="hljs-string">"c"</span> : <span class="hljs-literal">null</span>, <span class="hljs-string">"d"</span> : <span class="hljs-number">3</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988371"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988371"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSq--D"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSq---"</span>
}
arangosh&gt; db.example.document(<span class="hljs-string">"example/19988371"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988371"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988371"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSq--D"</span>,
<span class="hljs-string">"d"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"c"</span> : <span class="hljs-literal">null</span>
}
arangosh&gt; db.example.update(<span class="hljs-string">"example/19988371"</span>, { <span class="hljs-string">"a"</span> : <span class="hljs-literal">null</span> }, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>);
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988371"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988371"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSu--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSq--D"</span>
}
arangosh&gt; db.example.document(<span class="hljs-string">"example/19988371"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988371"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988371"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSu--_"</span>,
<span class="hljs-string">"d"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"c"</span> : <span class="hljs-literal">null</span>
}
arangosh&gt; db.example.update(<span class="hljs-string">"example/19988371"</span>,
........&gt; { <span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span>, <span class="hljs-string">"c"</span>: <span class="hljs-literal">null</span>, <span class="hljs-string">"d"</span> : <span class="hljs-literal">null</span> }, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>);
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988371"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988371"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSu--B"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSu--_"</span>
}
arangosh&gt; db.example.document(<span class="hljs-string">"example/19988371"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"19988371"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/19988371"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSu--B"</span>
}
</pre>
<div id="documentsCollection_UpdateHandleKeepNull_container_collapse" onclick="$('#documentsCollection_UpdateHandleKeepNull_long').hide(); $('#documentsCollection_UpdateHandleKeepNull_short').show(); window.location.hash='documentsCollection_UpdateHandleKeepNull_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollection_UpdateHandleKeepNull_short" onclick="$('#documentsCollection_UpdateHandleKeepNull_short').hide(); $('#documentsCollection_UpdateHandleKeepNull_long').show();">
<pre>
arangosh&gt; db.example.insert({<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>});
arangosh&gt; db.example.update(<span class="hljs-string">"example/19988371"</span>,
........&gt; { <span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span>, <span class="hljs-string">"c"</span> : <span class="hljs-literal">null</span>, <span class="hljs-string">"d"</span> : <span class="hljs-number">3</span> });
arangosh&gt; db.example.document(<span class="hljs-string">"example/19988371"</span>);
arangosh&gt; db.example.update(<span class="hljs-string">"example/19988371"</span>, { <span class="hljs-string">"a"</span> : <span class="hljs-literal">null</span> }, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>);
arangosh&gt; db.example.document(<span class="hljs-string">"example/19988371"</span>);
arangosh&gt; db.example.update(<span class="hljs-string">"example/19988371"</span>,
........&gt; { <span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span>, <span class="hljs-string">"c"</span>: <span class="hljs-literal">null</span>, <span class="hljs-string">"d"</span> : <span class="hljs-literal">null</span> }, <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>);
arangosh&gt; db.example.document(<span class="hljs-string">"example/19988371"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollection_UpdateHandleKeepNull
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentsCollection_UpdateHandleArray
<div class="example-container" id="documentsCollection_UpdateHandleArray_container">
<a class="anchorjs-link " href="#documentsCollection_UpdateHandleArray_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollection_UpdateHandleArray_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({<span class="hljs-string">"a"</span> : { <span class="hljs-string">"one"</span> : <span class="hljs-number">1</span>, <span class="hljs-string">"two"</span> : <span class="hljs-number">2</span>, <span class="hljs-string">"three"</span> : <span class="hljs-number">3</span> },
........&gt; <span class="hljs-string">"b"</span> : { }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/20774804"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"20774804"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSW--C"</span>
}
arangosh&gt; db.example.update(<span class="hljs-string">"example/20774803"</span>, {<span class="hljs-string">"a"</span> : { <span class="hljs-string">"four"</span> : <span class="hljs-number">4</span> },
........&gt; <span class="hljs-string">"b"</span> : { <span class="hljs-string">"b1"</span> : <span class="hljs-number">1</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/20774803"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"20774803"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSa--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSW--A"</span>
}
arangosh&gt; db.example.document(<span class="hljs-string">"example/20774803"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"20774803"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/20774803"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSa--_"</span>,
<span class="hljs-string">"b"</span> : {
<span class="hljs-string">"b1"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"four"</span> : <span class="hljs-number">4</span>
}
}
arangosh&gt; db.example.update(<span class="hljs-string">"example/20774803"</span>, { <span class="hljs-string">"a"</span> : { <span class="hljs-string">"one"</span> : <span class="hljs-literal">null</span> },
........&gt; <span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span> },
........&gt; <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>);
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/20774803"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"20774803"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSa--B"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dSa--_"</span>
}
arangosh&gt; db.example.document(<span class="hljs-string">"example/20774803"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"20774803"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/20774803"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dSa--B"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"four"</span> : <span class="hljs-number">4</span>
}
}
</pre>
<div id="documentsCollection_UpdateHandleArray_container_collapse" onclick="$('#documentsCollection_UpdateHandleArray_long').hide(); $('#documentsCollection_UpdateHandleArray_short').show(); window.location.hash='documentsCollection_UpdateHandleArray_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollection_UpdateHandleArray_short" onclick="$('#documentsCollection_UpdateHandleArray_short').hide(); $('#documentsCollection_UpdateHandleArray_long').show();">
<pre>
arangosh&gt; db.example.insert({<span class="hljs-string">"a"</span> : { <span class="hljs-string">"one"</span> : <span class="hljs-number">1</span>, <span class="hljs-string">"two"</span> : <span class="hljs-number">2</span>, <span class="hljs-string">"three"</span> : <span class="hljs-number">3</span> },
........&gt; <span class="hljs-string">"b"</span> : { }});
arangosh&gt; db.example.update(<span class="hljs-string">"example/20774803"</span>, {<span class="hljs-string">"a"</span> : { <span class="hljs-string">"four"</span> : <span class="hljs-number">4</span> },
........&gt; <span class="hljs-string">"b"</span> : { <span class="hljs-string">"b1"</span> : <span class="hljs-number">1</span> }});
arangosh&gt; db.example.document(<span class="hljs-string">"example/20774803"</span>);
arangosh&gt; db.example.update(<span class="hljs-string">"example/20774803"</span>, { <span class="hljs-string">"a"</span> : { <span class="hljs-string">"one"</span> : <span class="hljs-literal">null</span> },
........&gt; <span class="hljs-string">"b"</span> : <span class="hljs-literal">null</span> },
........&gt; <span class="hljs-literal">false</span>, <span class="hljs-literal">false</span>);
arangosh&gt; db.example.document(<span class="hljs-string">"example/20774803"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollection_UpdateHandleArray
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentDocumentRemoveSimple
<div class="example-container" id="documentDocumentRemoveSimple_container">
<a class="anchorjs-link " href="#documentDocumentRemoveSimple_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentDocumentRemoveSimple_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74105"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74105"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dM2--A"</span>
}
arangosh&gt; db.example.document(a1);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74105"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74105"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dM2--A"</span>,
<span class="hljs-string">"a"</span> : <span class="hljs-number">1</span>
}
arangosh&gt; db.example.remove(a1);
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74105"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74105"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dM2--A"</span>
}
arangosh&gt; db.example.document(a1);
[ArangoError <span class="hljs-number">1202</span>: <span class="hljs-built_in">document</span> not found]
</pre>
<div id="documentDocumentRemoveSimple_container_collapse" onclick="$('#documentDocumentRemoveSimple_long').hide(); $('#documentDocumentRemoveSimple_short').show(); window.location.hash='documentDocumentRemoveSimple_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentDocumentRemoveSimple_short" onclick="$('#documentDocumentRemoveSimple_short').hide(); $('#documentDocumentRemoveSimple_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; db.example.document(a1);
arangosh&gt; db.example.remove(a1);
arangosh&gt; db.example.document(a1);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentDocumentRemoveSimple
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline documentDocumentRemoveConflict
<div class="example-container" id="documentDocumentRemoveConflict_container">
<a class="anchorjs-link " href="#documentDocumentRemoveConflict_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentDocumentRemoveConflict_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74092"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74092"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dMm---"</span>
}
arangosh&gt; a2 = db.example.replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74092"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74092"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dMm--B"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dMm---"</span>
}
arangosh&gt; db.example.remove(a1);
[ArangoError <span class="hljs-number">1200</span>: precondition failed]
arangosh&gt; db.example.remove(a1, <span class="hljs-literal">true</span>);
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74092"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74092"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dMm--B"</span>
}
arangosh&gt; db.example.document(a1);
[ArangoError <span class="hljs-number">1202</span>: <span class="hljs-built_in">document</span> not found]
</pre>
<div id="documentDocumentRemoveConflict_container_collapse" onclick="$('#documentDocumentRemoveConflict_long').hide(); $('#documentDocumentRemoveConflict_short').show(); window.location.hash='documentDocumentRemoveConflict_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentDocumentRemoveConflict_short" onclick="$('#documentDocumentRemoveConflict_short').hide(); $('#documentDocumentRemoveConflict_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; a2 = db.example.replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
arangosh&gt; db.example.remove(a1);
arangosh&gt; db.example.remove(a1, <span class="hljs-literal">true</span>);
arangosh&gt; db.example.document(a1);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentDocumentRemoveConflict
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline collectionRemoveByKeys
<div class="example-container" id="collectionRemoveByKeys_container">
<a class="anchorjs-link " href="#collectionRemoveByKeys_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionRemoveByKeys_long" style="Display: none;">
<pre>
arangosh&gt; keys = [ ];
[ ]
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; ++i) {
........&gt; db.example.insert({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"test"</span> + i, <span class="hljs-attr">value</span>: i });
........&gt; keys.push(<span class="hljs-string">"test"</span> + i);
........&gt; }
arangosh&gt; db.example.removeByKeys(keys);
{
<span class="hljs-string">"removed"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="collectionRemoveByKeys_container_collapse" onclick="$('#collectionRemoveByKeys_long').hide(); $('#collectionRemoveByKeys_short').show(); window.location.hash='collectionRemoveByKeys_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionRemoveByKeys_short" onclick="$('#collectionRemoveByKeys_short').hide(); $('#collectionRemoveByKeys_long').show();">
<pre>
arangosh&gt; keys = [ ];
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; ++i) {
........&gt; db.example.insert({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"test"</span> + i, <span class="hljs-attr">value</span>: i });
........&gt; keys.push(<span class="hljs-string">"test"</span> + i);
........&gt; }
arangosh&gt; db.example.removeByKeys(keys);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionRemoveByKeys
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 010_documentsCollectionRemoveByExample
<div class="example-container" id="010_documentsCollectionRemoveByExample_container">
<a class="anchorjs-link " href="#010_documentsCollectionRemoveByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="010_documentsCollectionRemoveByExample_long">
<pre>
arangosh&gt; db.example.removeByExample( {<span class="hljs-attr">Hello</span> : <span class="hljs-string">"world"</span>} );
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock 010_documentsCollectionRemoveByExample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 011_documentsCollectionReplaceByExample
<div class="example-container" id="011_documentsCollectionReplaceByExample_container">
<a class="anchorjs-link " href="#011_documentsCollectionReplaceByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="011_documentsCollectionReplaceByExample_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"world"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/4501"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"4501"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ozm---"</span>
}
arangosh&gt; db.example.replaceByExample({ <span class="hljs-attr">Hello</span>: <span class="hljs-string">"world"</span> }, {<span class="hljs-attr">Hello</span>: <span class="hljs-string">"mars"</span>}, <span class="hljs-literal">false</span>, <span class="hljs-number">5</span>);
<span class="hljs-number">1</span>
</pre>
<div id="011_documentsCollectionReplaceByExample_container_collapse" onclick="$('#011_documentsCollectionReplaceByExample_long').hide(); $('#011_documentsCollectionReplaceByExample_short').show(); window.location.hash='011_documentsCollectionReplaceByExample_container';" class="example_show_button">Hide execution results</div></div>
<div id="011_documentsCollectionReplaceByExample_short" onclick="$('#011_documentsCollectionReplaceByExample_short').hide(); $('#011_documentsCollectionReplaceByExample_long').show();">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"world"</span> });
arangosh&gt; db.example.replaceByExample({ <span class="hljs-attr">Hello</span>: <span class="hljs-string">"world"</span> }, {<span class="hljs-attr">Hello</span>: <span class="hljs-string">"mars"</span>}, <span class="hljs-literal">false</span>, <span class="hljs-number">5</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 011_documentsCollectionReplaceByExample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline 012_documentsCollectionUpdateByExample
<div class="example-container" id="012_documentsCollectionUpdateByExample_container">
<a class="anchorjs-link " href="#012_documentsCollectionUpdateByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="012_documentsCollectionUpdateByExample_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"world"</span>, <span class="hljs-attr">foo</span> : <span class="hljs-string">"bar"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/4511"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"4511"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5oz2--A"</span>
}
arangosh&gt; db.example.updateByExample({ <span class="hljs-attr">Hello</span>: <span class="hljs-string">"world"</span> }, { <span class="hljs-attr">Hello</span>: <span class="hljs-string">"foo"</span>, <span class="hljs-attr">World</span>: <span class="hljs-string">"bar"</span> }, <span class="hljs-literal">false</span>);
<span class="hljs-number">1</span>
arangosh&gt; db.example.byExample({ <span class="hljs-attr">Hello</span>: <span class="hljs-string">"foo"</span> }).toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"4511"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/4511"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5o0---_"</span>,
<span class="hljs-string">"Hello"</span> : <span class="hljs-string">"foo"</span>,
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>,
<span class="hljs-string">"World"</span> : <span class="hljs-string">"bar"</span>
}
]
</pre>
<div id="012_documentsCollectionUpdateByExample_container_collapse" onclick="$('#012_documentsCollectionUpdateByExample_long').hide(); $('#012_documentsCollectionUpdateByExample_short').show(); window.location.hash='012_documentsCollectionUpdateByExample_container';" class="example_show_button">Hide execution results</div></div>
<div id="012_documentsCollectionUpdateByExample_short" onclick="$('#012_documentsCollectionUpdateByExample_short').hide(); $('#012_documentsCollectionUpdateByExample_long').show();">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">Hello</span> : <span class="hljs-string">"world"</span>, <span class="hljs-attr">foo</span> : <span class="hljs-string">"bar"</span> });
arangosh&gt; db.example.updateByExample({ <span class="hljs-attr">Hello</span>: <span class="hljs-string">"world"</span> }, { <span class="hljs-attr">Hello</span>: <span class="hljs-string">"foo"</span>, <span class="hljs-attr">World</span>: <span class="hljs-string">"bar"</span> }, <span class="hljs-literal">false</span>);
arangosh&gt; db.example.byExample({ <span class="hljs-attr">Hello</span>: <span class="hljs-string">"foo"</span> }).toArray()
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 012_documentsCollectionUpdateByExample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline dbVersion
<div class="example-container" id="dbVersion_container">
<a class="anchorjs-link " href="#dbVersion_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="dbVersion_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db._version();
<span class="hljs-number">3.5</span><span class="hljs-number">.1</span>
</pre>
</div>
</div>
@endDocuBlock dbVersion
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline EDGCOL_02_Relation
<div class="example-container" id="EDGCOL_02_Relation_container">
<a class="anchorjs-link " href="#EDGCOL_02_Relation_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="EDGCOL_02_Relation_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"vertex"</span>);
[ArangoCollection <span class="hljs-number">65396</span>, <span class="hljs-string">"vertex"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._createEdgeCollection(<span class="hljs-string">"relation"</span>);
[ArangoCollection <span class="hljs-number">65401</span>, <span class="hljs-string">"relation"</span> (type edge, status loaded)]
arangosh&gt; <span class="hljs-keyword">var</span> myGraph = {};
arangosh&gt; myGraph.v1 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 1"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"vertex/65408"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65408"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vue---"</span>
}
arangosh&gt; myGraph.v2 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 2"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"vertex/65410"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65410"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vue--A"</span>
}
arangosh&gt; myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........&gt; { <span class="hljs-attr">label</span> : <span class="hljs-string">"knows"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65412"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65412"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vui---"</span>
}
arangosh&gt; db._document(myGraph.e1);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65412"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65412"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertex/65408"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertex/65410"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vui---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"knows"</span>
}
arangosh&gt; db.relation.edges(myGraph.e1._id);
[ ]
</pre>
<div id="EDGCOL_02_Relation_container_collapse" onclick="$('#EDGCOL_02_Relation_long').hide(); $('#EDGCOL_02_Relation_short').show(); window.location.hash='EDGCOL_02_Relation_container';" class="example_show_button">Hide execution results</div></div>
<div id="EDGCOL_02_Relation_short" onclick="$('#EDGCOL_02_Relation_short').hide(); $('#EDGCOL_02_Relation_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"vertex"</span>);
arangosh&gt; db._createEdgeCollection(<span class="hljs-string">"relation"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> myGraph = {};
arangosh&gt; myGraph.v1 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 1"</span> });
arangosh&gt; myGraph.v2 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 2"</span> });
arangosh&gt; myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........&gt; { <span class="hljs-attr">label</span> : <span class="hljs-string">"knows"</span>});
arangosh&gt; db._document(myGraph.e1);
arangosh&gt; db.relation.edges(myGraph.e1._id);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock EDGCOL_02_Relation
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline EDGCOL_02_inEdges
<div class="example-container" id="EDGCOL_02_inEdges_container">
<a class="anchorjs-link " href="#EDGCOL_02_inEdges_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="EDGCOL_02_inEdges_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"vertex"</span>);
[ArangoCollection <span class="hljs-number">65419</span>, <span class="hljs-string">"vertex"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._createEdgeCollection(<span class="hljs-string">"relation"</span>);
[ArangoCollection <span class="hljs-number">65424</span>, <span class="hljs-string">"relation"</span> (type edge, status loaded)]
arangosh&gt; myGraph.v1 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 1"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"vertex/65431"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65431"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vu2---"</span>
}
arangosh&gt; myGraph.v2 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 2"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"vertex/65433"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65433"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vu2--A"</span>
}
arangosh&gt; myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........&gt; { <span class="hljs-attr">label</span> : <span class="hljs-string">"knows"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65435"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65435"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vu2--C"</span>
}
arangosh&gt; db._document(myGraph.e1);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65435"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65435"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertex/65431"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertex/65433"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vu2--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"knows"</span>
}
arangosh&gt; db.relation.inEdges(myGraph.v1._id);
[ ]
arangosh&gt; db.relation.inEdges(myGraph.v2._id);
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65435"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65435"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertex/65431"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertex/65433"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vu2--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"knows"</span>
}
]
</pre>
<div id="EDGCOL_02_inEdges_container_collapse" onclick="$('#EDGCOL_02_inEdges_long').hide(); $('#EDGCOL_02_inEdges_short').show(); window.location.hash='EDGCOL_02_inEdges_container';" class="example_show_button">Hide execution results</div></div>
<div id="EDGCOL_02_inEdges_short" onclick="$('#EDGCOL_02_inEdges_short').hide(); $('#EDGCOL_02_inEdges_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"vertex"</span>);
arangosh&gt; db._createEdgeCollection(<span class="hljs-string">"relation"</span>);
arangosh&gt; myGraph.v1 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 1"</span> });
arangosh&gt; myGraph.v2 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 2"</span> });
arangosh&gt; myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........&gt; { <span class="hljs-attr">label</span> : <span class="hljs-string">"knows"</span>});
arangosh&gt; db._document(myGraph.e1);
arangosh&gt; db.relation.inEdges(myGraph.v1._id);
arangosh&gt; db.relation.inEdges(myGraph.v2._id);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock EDGCOL_02_inEdges
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline EDGCOL_02_outEdges
<div class="example-container" id="EDGCOL_02_outEdges_container">
<a class="anchorjs-link " href="#EDGCOL_02_outEdges_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="EDGCOL_02_outEdges_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"vertex"</span>);
[ArangoCollection <span class="hljs-number">65443</span>, <span class="hljs-string">"vertex"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._createEdgeCollection(<span class="hljs-string">"relation"</span>);
[ArangoCollection <span class="hljs-number">65448</span>, <span class="hljs-string">"relation"</span> (type edge, status loaded)]
arangosh&gt; myGraph.v1 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 1"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"vertex/65455"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65455"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vvO--A"</span>
}
arangosh&gt; myGraph.v2 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 2"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"vertex/65457"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65457"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vvS---"</span>
}
arangosh&gt; myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........&gt; { <span class="hljs-attr">label</span> : <span class="hljs-string">"knows"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65459"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65459"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vvS--A"</span>
}
arangosh&gt; db._document(myGraph.e1);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65459"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65459"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertex/65455"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertex/65457"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vvS--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"knows"</span>
}
arangosh&gt; db.relation.outEdges(myGraph.v1._id);
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65459"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/65459"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertex/65455"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertex/65457"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vvS--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"knows"</span>
}
]
arangosh&gt; db.relation.outEdges(myGraph.v2._id);
[ ]
</pre>
<div id="EDGCOL_02_outEdges_container_collapse" onclick="$('#EDGCOL_02_outEdges_long').hide(); $('#EDGCOL_02_outEdges_short').show(); window.location.hash='EDGCOL_02_outEdges_container';" class="example_show_button">Hide execution results</div></div>
<div id="EDGCOL_02_outEdges_short" onclick="$('#EDGCOL_02_outEdges_short').hide(); $('#EDGCOL_02_outEdges_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"vertex"</span>);
arangosh&gt; db._createEdgeCollection(<span class="hljs-string">"relation"</span>);
arangosh&gt; myGraph.v1 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 1"</span> });
arangosh&gt; myGraph.v2 = db.vertex.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"vertex 2"</span> });
arangosh&gt; myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2,
........&gt; { <span class="hljs-attr">label</span> : <span class="hljs-string">"knows"</span>});
arangosh&gt; db._document(myGraph.e1);
arangosh&gt; db.relation.outEdges(myGraph.v1._id);
arangosh&gt; db.relation.outEdges(myGraph.v2._id);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock EDGCOL_02_outEdges
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-document-methods.md -->
@startDocuBlockInline accessViaGeoIndex
<div class="example-container" id="accessViaGeoIndex_container">
<a class="anchorjs-link " href="#accessViaGeoIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="accessViaGeoIndex_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.example.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; home : [ i, j ],
........&gt; work : [ -i, -j ] });
........&gt; }
........&gt; }
........&gt;
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"home"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"home"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/73524"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081199046656"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; items = db.example.getIndexes().map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x</span>) </span>{ <span class="hljs-keyword">return</span> x.id; });
........&gt; db.example.index(items[<span class="hljs-number">1</span>]);
[
<span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"example/73524"</span>
]
</pre>
<div id="accessViaGeoIndex_container_collapse" onclick="$('#accessViaGeoIndex_long').hide(); $('#accessViaGeoIndex_short').show(); window.location.hash='accessViaGeoIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="accessViaGeoIndex_short" onclick="$('#accessViaGeoIndex_short').hide(); $('#accessViaGeoIndex_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.example.insert({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; home : [ i, j ],
........&gt; work : [ -i, -j ] });
........&gt; }
........&gt; }
........&gt;
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"home"</span> ] });
arangosh&gt; items = db.example.getIndexes().map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x</span>) </span>{ <span class="hljs-keyword">return</span> x.id; });
........&gt; db.example.index(items[<span class="hljs-number">1</span>]);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock accessViaGeoIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-smart-graphs.md -->
@startDocuBlockInline smartGraphCreateGraphHowTo1
arangosh> var graph_module = require("@arangodb/smart-graph");
arangosh> var graph = graph_module._create("myGraph", [], [], {smartGraphAttribute: "region", numberOfShards: 9});
arangosh> graph;
[ SmartGraph myGraph EdgeDefinitions: [ ] VertexCollections: [ ] ]
@endDocuBlock smartGraphCreateGraphHowTo1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-smart-graphs.md -->
@startDocuBlockInline smartGraphCreateGraphHowTo2
arangosh> graph._addVertexCollection("shop");
arangosh> graph._addVertexCollection("customer");
arangosh> graph._addVertexCollection("pet");
arangosh> graph;
[ SmartGraph myGraph EdgeDefinitions: [ ] VertexCollections: [ "shop", "customer", "pet" ] ]
@endDocuBlock smartGraphCreateGraphHowTo2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-smart-graphs.md -->
@startDocuBlockInline smartGraphCreateGraphHowTo3
arangosh> var rel = graph_module._relation("isCustomer", ["shop"], ["customer"]);
arangosh> graph._extendEdgeDefinitions(rel);
arangosh> graph;
[ SmartGraph myGraph EdgeDefinitions: [ "isCustomer: [shop] -> [customer]" ] VertexCollections: [ "pet" ] ]
@endDocuBlock smartGraphCreateGraphHowTo3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphGetFromVertex
<div class="example-container" id="generalGraphGetFromVertex_container">
<a class="anchorjs-link " href="#generalGraphGetFromVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphGetFromVertex_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> any = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db.relation.any();
arangosh&gt; graph._fromVertex(<span class="hljs-string">"relation/"</span> + any._key);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dha---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
}
</pre>
<div id="generalGraphGetFromVertex_container_collapse" onclick="$('#generalGraphGetFromVertex_long').hide(); $('#generalGraphGetFromVertex_short').show(); window.location.hash='generalGraphGetFromVertex_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphGetFromVertex_short" onclick="$('#generalGraphGetFromVertex_short').hide(); $('#generalGraphGetFromVertex_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> any = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db.relation.any();
arangosh&gt; graph._fromVertex(<span class="hljs-string">"relation/"</span> + any._key);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphGetFromVertex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphGetToVertex
<div class="example-container" id="generalGraphGetToVertex_container">
<a class="anchorjs-link " href="#generalGraphGetToVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphGetToVertex_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> any = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db.relation.any();
arangosh&gt; graph._toVertex(<span class="hljs-string">"relation/"</span> + any._key);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6diC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
</pre>
<div id="generalGraphGetToVertex_container_collapse" onclick="$('#generalGraphGetToVertex_long').hide(); $('#generalGraphGetToVertex_short').show(); window.location.hash='generalGraphGetToVertex_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphGetToVertex_short" onclick="$('#generalGraphGetToVertex_short').hide(); $('#generalGraphGetToVertex_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> any = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).db.relation.any();
arangosh&gt; graph._toVertex(<span class="hljs-string">"relation/"</span> + any._key);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphGetToVertex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleNeighbors1
<div class="example-container" id="generalGraphModuleNeighbors1_container">
<a class="anchorjs-link " href="#generalGraphModuleNeighbors1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleNeighbors1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._neighbors({<span class="hljs-attr">isCapital</span> : <span class="hljs-literal">true</span>});
[
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>
]
</pre>
<div id="generalGraphModuleNeighbors1_container_collapse" onclick="$('#generalGraphModuleNeighbors1_long').hide(); $('#generalGraphModuleNeighbors1_short').show(); window.location.hash='generalGraphModuleNeighbors1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleNeighbors1_short" onclick="$('#generalGraphModuleNeighbors1_short').hide(); $('#generalGraphModuleNeighbors1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._neighbors({<span class="hljs-attr">isCapital</span> : <span class="hljs-literal">true</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleNeighbors1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleNeighbors2
<div class="example-container" id="generalGraphModuleNeighbors2_container">
<a class="anchorjs-link " href="#generalGraphModuleNeighbors2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleNeighbors2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._neighbors(<span class="hljs-string">'germanCity/Hamburg'</span>, {<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span> : <span class="hljs-number">2</span>});
[
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
]
</pre>
<div id="generalGraphModuleNeighbors2_container_collapse" onclick="$('#generalGraphModuleNeighbors2_long').hide(); $('#generalGraphModuleNeighbors2_short').show(); window.location.hash='generalGraphModuleNeighbors2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleNeighbors2_short" onclick="$('#generalGraphModuleNeighbors2_short').hide(); $('#generalGraphModuleNeighbors2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._neighbors(<span class="hljs-string">'germanCity/Hamburg'</span>, {<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span> : <span class="hljs-number">2</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleNeighbors2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCommonNeighbors1
<div class="example-container" id="generalGraphModuleCommonNeighbors1_container">
<a class="anchorjs-link " href="#generalGraphModuleCommonNeighbors1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCommonNeighbors1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonNeighbors({<span class="hljs-attr">isCapital</span> : <span class="hljs-literal">true</span>}, {<span class="hljs-attr">isCapital</span> : <span class="hljs-literal">true</span>});
[
{
<span class="hljs-string">"left"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"neighbors"</span> : [
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
]
},
{
<span class="hljs-string">"left"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"neighbors"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>
]
}
]
</pre>
<div id="generalGraphModuleCommonNeighbors1_container_collapse" onclick="$('#generalGraphModuleCommonNeighbors1_long').hide(); $('#generalGraphModuleCommonNeighbors1_short').show(); window.location.hash='generalGraphModuleCommonNeighbors1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCommonNeighbors1_short" onclick="$('#generalGraphModuleCommonNeighbors1_short').hide(); $('#generalGraphModuleCommonNeighbors1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonNeighbors({<span class="hljs-attr">isCapital</span> : <span class="hljs-literal">true</span>}, {<span class="hljs-attr">isCapital</span> : <span class="hljs-literal">true</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCommonNeighbors1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCommonNeighbors2
<div class="example-container" id="generalGraphModuleCommonNeighbors2_container">
<a class="anchorjs-link " href="#generalGraphModuleCommonNeighbors2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCommonNeighbors2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonNeighbors(
........&gt; <span class="hljs-string">'germanCity/Hamburg'</span>,
........&gt; {},
........&gt; {<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span> : <span class="hljs-number">2</span>},
........&gt; {<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span> : <span class="hljs-number">2</span>});
[
{
<span class="hljs-string">"left"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"neighbors"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>
]
},
{
<span class="hljs-string">"left"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"neighbors"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>
]
},
{
<span class="hljs-string">"left"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"neighbors"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>
]
}
]
</pre>
<div id="generalGraphModuleCommonNeighbors2_container_collapse" onclick="$('#generalGraphModuleCommonNeighbors2_long').hide(); $('#generalGraphModuleCommonNeighbors2_short').show(); window.location.hash='generalGraphModuleCommonNeighbors2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCommonNeighbors2_short" onclick="$('#generalGraphModuleCommonNeighbors2_short').hide(); $('#generalGraphModuleCommonNeighbors2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonNeighbors(
........&gt; <span class="hljs-string">'germanCity/Hamburg'</span>,
........&gt; {},
........&gt; {<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span> : <span class="hljs-number">2</span>},
........&gt; {<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span> : <span class="hljs-number">2</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCommonNeighbors2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCommonNeighborsAmount1
<div class="example-container" id="generalGraphModuleCommonNeighborsAmount1_container">
<a class="anchorjs-link " href="#generalGraphModuleCommonNeighborsAmount1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCommonNeighborsAmount1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> example = { <span class="hljs-attr">isCapital</span>: <span class="hljs-literal">true</span> };
arangosh&gt; <span class="hljs-keyword">var</span> options = { <span class="hljs-attr">includeData</span>: <span class="hljs-literal">true</span> };
arangosh&gt; graph._countCommonNeighbors(example, example, options, options);
[
{
<span class="hljs-string">"frenchCity/Paris"</span> : [
{
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">3</span>
}
]
},
{
<span class="hljs-string">"germanCity/Berlin"</span> : [
{
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">3</span>
}
]
}
]
</pre>
<div id="generalGraphModuleCommonNeighborsAmount1_container_collapse" onclick="$('#generalGraphModuleCommonNeighborsAmount1_long').hide(); $('#generalGraphModuleCommonNeighborsAmount1_short').show(); window.location.hash='generalGraphModuleCommonNeighborsAmount1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCommonNeighborsAmount1_short" onclick="$('#generalGraphModuleCommonNeighborsAmount1_short').hide(); $('#generalGraphModuleCommonNeighborsAmount1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> example = { <span class="hljs-attr">isCapital</span>: <span class="hljs-literal">true</span> };
arangosh&gt; <span class="hljs-keyword">var</span> options = { <span class="hljs-attr">includeData</span>: <span class="hljs-literal">true</span> };
arangosh&gt; graph._countCommonNeighbors(example, example, options, options);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCommonNeighborsAmount1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCommonNeighborsAmount2
<div class="example-container" id="generalGraphModuleCommonNeighborsAmount2_container">
<a class="anchorjs-link " href="#generalGraphModuleCommonNeighborsAmount2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCommonNeighborsAmount2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> options = { <span class="hljs-attr">direction</span>: <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">includeData</span>: <span class="hljs-literal">true</span> };
arangosh&gt; graph._countCommonNeighbors(<span class="hljs-string">'germanCity/Hamburg'</span>, {}, options, options);
[
{
<span class="hljs-string">"germanCity/Hamburg"</span> : [
{
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">2</span>
}
]
}
]
</pre>
<div id="generalGraphModuleCommonNeighborsAmount2_container_collapse" onclick="$('#generalGraphModuleCommonNeighborsAmount2_long').hide(); $('#generalGraphModuleCommonNeighborsAmount2_short').show(); window.location.hash='generalGraphModuleCommonNeighborsAmount2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCommonNeighborsAmount2_short" onclick="$('#generalGraphModuleCommonNeighborsAmount2_short').hide(); $('#generalGraphModuleCommonNeighborsAmount2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> options = { <span class="hljs-attr">direction</span>: <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">maxDepth</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">includeData</span>: <span class="hljs-literal">true</span> };
arangosh&gt; graph._countCommonNeighbors(<span class="hljs-string">'germanCity/Hamburg'</span>, {}, options, options);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCommonNeighborsAmount2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleProperties1
<div class="example-container" id="generalGraphModuleProperties1_container">
<a class="anchorjs-link " href="#generalGraphModuleProperties1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleProperties1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonProperties({}, {});
[
{
<span class="hljs-string">"frenchCity/Lyon"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
}
]
},
{
<span class="hljs-string">"frenchCity/Paris"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">true</span>
}
]
},
{
<span class="hljs-string">"germanCity/Berlin"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">true</span>
}
]
},
{
<span class="hljs-string">"germanCity/Cologne"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">1000000</span>
}
]
},
{
<span class="hljs-string">"germanCity/Hamburg"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">1000000</span>
}
]
}
]
</pre>
<div id="generalGraphModuleProperties1_container_collapse" onclick="$('#generalGraphModuleProperties1_long').hide(); $('#generalGraphModuleProperties1_short').show(); window.location.hash='generalGraphModuleProperties1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleProperties1_short" onclick="$('#generalGraphModuleProperties1_short').hide(); $('#generalGraphModuleProperties1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonProperties({}, {});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleProperties1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleProperties2
<div class="example-container" id="generalGraphModuleProperties2_container">
<a class="anchorjs-link " href="#generalGraphModuleProperties2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleProperties2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonProperties({}, {}, {<span class="hljs-attr">ignoreProperties</span>: <span class="hljs-string">'population'</span>});
[
{
<span class="hljs-string">"frenchCity/Lyon"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
}
]
},
{
<span class="hljs-string">"frenchCity/Paris"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">true</span>
}
]
},
{
<span class="hljs-string">"germanCity/Berlin"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">true</span>
}
]
},
{
<span class="hljs-string">"germanCity/Cologne"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
}
]
},
{
<span class="hljs-string">"germanCity/Hamburg"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>
}
]
}
]
</pre>
<div id="generalGraphModuleProperties2_container_collapse" onclick="$('#generalGraphModuleProperties2_long').hide(); $('#generalGraphModuleProperties2_short').show(); window.location.hash='generalGraphModuleProperties2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleProperties2_short" onclick="$('#generalGraphModuleProperties2_short').hide(); $('#generalGraphModuleProperties2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._commonProperties({}, {}, {<span class="hljs-attr">ignoreProperties</span>: <span class="hljs-string">'population'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleProperties2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAmountProperties1
<div class="example-container" id="generalGraphModuleAmountProperties1_container">
<a class="anchorjs-link " href="#generalGraphModuleAmountProperties1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAmountProperties1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._countCommonProperties({}, {});
[
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">2</span>
}
]
</pre>
<div id="generalGraphModuleAmountProperties1_container_collapse" onclick="$('#generalGraphModuleAmountProperties1_long').hide(); $('#generalGraphModuleAmountProperties1_short').show(); window.location.hash='generalGraphModuleAmountProperties1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAmountProperties1_short" onclick="$('#generalGraphModuleAmountProperties1_short').hide(); $('#generalGraphModuleAmountProperties1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._countCommonProperties({}, {});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAmountProperties1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAmountProperties2
<div class="example-container" id="generalGraphModuleAmountProperties2_container">
<a class="anchorjs-link " href="#generalGraphModuleAmountProperties2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAmountProperties2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._countCommonProperties({}, {}, {<span class="hljs-attr">vertex1CollectionRestriction</span> : <span class="hljs-string">'germanCity'</span>,
........&gt; vertex2CollectionRestriction : <span class="hljs-string">'germanCity'</span> ,<span class="hljs-attr">ignoreProperties</span>: <span class="hljs-string">'population'</span>});
[
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">2</span>
}
]
</pre>
<div id="generalGraphModuleAmountProperties2_container_collapse" onclick="$('#generalGraphModuleAmountProperties2_long').hide(); $('#generalGraphModuleAmountProperties2_short').show(); window.location.hash='generalGraphModuleAmountProperties2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAmountProperties2_short" onclick="$('#generalGraphModuleAmountProperties2_short').hide(); $('#generalGraphModuleAmountProperties2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._countCommonProperties({}, {}, {<span class="hljs-attr">vertex1CollectionRestriction</span> : <span class="hljs-string">'germanCity'</span>,
........&gt; vertex2CollectionRestriction : <span class="hljs-string">'germanCity'</span> ,<span class="hljs-attr">ignoreProperties</span>: <span class="hljs-string">'population'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAmountProperties2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModulePaths1
<div class="example-container" id="generalGraphModulePaths1_container">
<a class="anchorjs-link " href="#generalGraphModulePaths1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModulePaths1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; g._paths();
[
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77877"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77877"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77877"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77877"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77883"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77883"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77879"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77879"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77879"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77879"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77881"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77881"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"charly"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77883"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77883"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77881"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77881"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBO--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"charly"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eBK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
}
]
}
]
</pre>
<div id="generalGraphModulePaths1_container_collapse" onclick="$('#generalGraphModulePaths1_long').hide(); $('#generalGraphModulePaths1_short').show(); window.location.hash='generalGraphModulePaths1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModulePaths1_short" onclick="$('#generalGraphModulePaths1_short').hide(); $('#generalGraphModulePaths1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; g._paths();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModulePaths1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModulePaths2
<div class="example-container" id="generalGraphModulePaths2_container">
<a class="anchorjs-link " href="#generalGraphModulePaths2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModulePaths2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; g._paths({<span class="hljs-attr">direction</span> : <span class="hljs-string">'inbound'</span>, <span class="hljs-attr">minLength</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">maxLength</span> : <span class="hljs-number">2</span>});
[
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77927"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77927"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCm--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"charly"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77927"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77927"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCm--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"charly"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77925"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77925"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCm--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77929"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77929"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCq---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77929"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77929"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCq---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77923"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77923"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCm---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77923"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77923"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCm---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"source"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
<span class="hljs-string">"destination"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"77925"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/77925"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCm--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertice"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eCi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
}
]
</pre>
<div id="generalGraphModulePaths2_container_collapse" onclick="$('#generalGraphModulePaths2_long').hide(); $('#generalGraphModulePaths2_short').show(); window.location.hash='generalGraphModulePaths2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModulePaths2_short" onclick="$('#generalGraphModulePaths2_short').hide(); $('#generalGraphModulePaths2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; g._paths({<span class="hljs-attr">direction</span> : <span class="hljs-string">'inbound'</span>, <span class="hljs-attr">minLength</span> : <span class="hljs-number">1</span>, <span class="hljs-attr">maxLength</span> : <span class="hljs-number">2</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModulePaths2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleShortestPaths1
<div class="example-container" id="generalGraphModuleShortestPaths1_container">
<a class="anchorjs-link " href="#generalGraphModuleShortestPaths1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleShortestPaths1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._shortestPath({}, {}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>, <span class="hljs-attr">endVertexCollectionRestriction</span> : <span class="hljs-string">'frenchCity'</span>,
........&gt; startVertexCollectionRestriction : <span class="hljs-string">'germanCity'</span>});
[
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78367"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchHighway/78367"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--C"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">550</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"germanCity/Berlin"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78369"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78369"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--E"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1100</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78377"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78377"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq--C"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">700</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78375"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78375"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq--A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1300</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78367"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchHighway/78367"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--C"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">550</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"germanCity/Berlin"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78371"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78371"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--G"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1200</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78379"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78379"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq--E"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">550</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78373"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78373"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq---"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">900</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78369"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78369"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--E"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1100</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78371"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78371"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--G"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1200</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78361"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/78361"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIi--_"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">850</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78363"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/78363"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm---"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">400</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78377"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78377"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq--C"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">700</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78379"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78379"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq--E"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">550</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"germanCity/Berlin"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78361"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/78361"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIi--_"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">850</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"germanCity/Hamburg"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78365"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/78365"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">500</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78375"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78375"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq--A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1300</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"frenchCity/Paris"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78373"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78373"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIq---"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">900</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"germanCity/Berlin"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78363"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/78363"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm---"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">400</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"germanCity/Cologne"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78365"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/78365"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eIm--A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">500</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
}
]
</pre>
<div id="generalGraphModuleShortestPaths1_container_collapse" onclick="$('#generalGraphModuleShortestPaths1_long').hide(); $('#generalGraphModuleShortestPaths1_short').show(); window.location.hash='generalGraphModuleShortestPaths1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleShortestPaths1_short" onclick="$('#generalGraphModuleShortestPaths1_short').hide(); $('#generalGraphModuleShortestPaths1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._shortestPath({}, {}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>, <span class="hljs-attr">endVertexCollectionRestriction</span> : <span class="hljs-string">'frenchCity'</span>,
........&gt; startVertexCollectionRestriction : <span class="hljs-string">'germanCity'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleShortestPaths1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleShortestPaths2
<div class="example-container" id="generalGraphModuleShortestPaths2_container">
<a class="anchorjs-link " href="#generalGraphModuleShortestPaths2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleShortestPaths2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._shortestPath([{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Cologne'</span>},{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Munich'</span>}], <span class="hljs-string">'frenchCity/Lyon'</span>,
........&gt; {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
[
{
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"frenchCity/Lyon"</span>
],
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"78453"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/78453"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eKC--G"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">700</span>
}
],
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
}
]
</pre>
<div id="generalGraphModuleShortestPaths2_container_collapse" onclick="$('#generalGraphModuleShortestPaths2_long').hide(); $('#generalGraphModuleShortestPaths2_short').show(); window.location.hash='generalGraphModuleShortestPaths2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleShortestPaths2_short" onclick="$('#generalGraphModuleShortestPaths2_short').hide(); $('#generalGraphModuleShortestPaths2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._shortestPath([{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Cologne'</span>},{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Munich'</span>}], <span class="hljs-string">'frenchCity/Lyon'</span>,
........&gt; {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleShortestPaths2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleDistanceTo1
<div class="example-container" id="generalGraphModuleDistanceTo1_container">
<a class="anchorjs-link " href="#generalGraphModuleDistanceTo1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleDistanceTo1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._distanceTo({}, {}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>, <span class="hljs-attr">endVertexCollectionRestriction</span> : <span class="hljs-string">'frenchCity'</span>,
........&gt; startVertexCollectionRestriction : <span class="hljs-string">'germanCity'</span>});
[
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
}
]
</pre>
<div id="generalGraphModuleDistanceTo1_container_collapse" onclick="$('#generalGraphModuleDistanceTo1_long').hide(); $('#generalGraphModuleDistanceTo1_short').show(); window.location.hash='generalGraphModuleDistanceTo1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleDistanceTo1_short" onclick="$('#generalGraphModuleDistanceTo1_short').hide(); $('#generalGraphModuleDistanceTo1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._distanceTo({}, {}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>, <span class="hljs-attr">endVertexCollectionRestriction</span> : <span class="hljs-string">'frenchCity'</span>,
........&gt; startVertexCollectionRestriction : <span class="hljs-string">'germanCity'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleDistanceTo1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleDistanceTo2
<div class="example-container" id="generalGraphModuleDistanceTo2_container">
<a class="anchorjs-link " href="#generalGraphModuleDistanceTo2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleDistanceTo2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._distanceTo([{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Cologne'</span>},{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Munich'</span>}], <span class="hljs-string">'frenchCity/Lyon'</span>,
........&gt; {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
[
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1</span>
}
]
</pre>
<div id="generalGraphModuleDistanceTo2_container_collapse" onclick="$('#generalGraphModuleDistanceTo2_long').hide(); $('#generalGraphModuleDistanceTo2_short').show(); window.location.hash='generalGraphModuleDistanceTo2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleDistanceTo2_short" onclick="$('#generalGraphModuleDistanceTo2_short').hide(); $('#generalGraphModuleDistanceTo2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; g._distanceTo([{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Cologne'</span>},{<span class="hljs-attr">_id</span>: <span class="hljs-string">'germanCity/Munich'</span>}], <span class="hljs-string">'frenchCity/Lyon'</span>,
........&gt; {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleDistanceTo2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsEccentricity1
<div class="example-container" id="generalGraphModuleAbsEccentricity1_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsEccentricity1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsEccentricity1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteEccentricity({});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleAbsEccentricity1_container_collapse" onclick="$('#generalGraphModuleAbsEccentricity1_long').hide(); $('#generalGraphModuleAbsEccentricity1_short').show(); window.location.hash='generalGraphModuleAbsEccentricity1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsEccentricity1_short" onclick="$('#generalGraphModuleAbsEccentricity1_short').hide(); $('#generalGraphModuleAbsEccentricity1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteEccentricity({});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsEccentricity1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsEccentricity2
<div class="example-container" id="generalGraphModuleAbsEccentricity2_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsEccentricity2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsEccentricity2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteEccentricity({}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleAbsEccentricity2_container_collapse" onclick="$('#generalGraphModuleAbsEccentricity2_long').hide(); $('#generalGraphModuleAbsEccentricity2_short').show(); window.location.hash='generalGraphModuleAbsEccentricity2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsEccentricity2_short" onclick="$('#generalGraphModuleAbsEccentricity2_short').hide(); $('#generalGraphModuleAbsEccentricity2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteEccentricity({}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsEccentricity2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsEccentricity3
<div class="example-container" id="generalGraphModuleAbsEccentricity3_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsEccentricity3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsEccentricity3_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteEccentricity({}, {<span class="hljs-attr">startVertexCollectionRestriction</span> : <span class="hljs-string">'germanCity'</span>,
........&gt; direction : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleAbsEccentricity3_container_collapse" onclick="$('#generalGraphModuleAbsEccentricity3_long').hide(); $('#generalGraphModuleAbsEccentricity3_short').show(); window.location.hash='generalGraphModuleAbsEccentricity3_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsEccentricity3_short" onclick="$('#generalGraphModuleAbsEccentricity3_short').hide(); $('#generalGraphModuleAbsEccentricity3_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteEccentricity({}, {<span class="hljs-attr">startVertexCollectionRestriction</span> : <span class="hljs-string">'germanCity'</span>,
........&gt; direction : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsEccentricity3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleEccentricity2
<div class="example-container" id="generalGraphModuleEccentricity2_container">
<a class="anchorjs-link " href="#generalGraphModuleEccentricity2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleEccentricity2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._eccentricity();
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleEccentricity2_container_collapse" onclick="$('#generalGraphModuleEccentricity2_long').hide(); $('#generalGraphModuleEccentricity2_short').show(); window.location.hash='generalGraphModuleEccentricity2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleEccentricity2_short" onclick="$('#generalGraphModuleEccentricity2_short').hide(); $('#generalGraphModuleEccentricity2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._eccentricity();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleEccentricity2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleEccentricity3
<div class="example-container" id="generalGraphModuleEccentricity3_container">
<a class="anchorjs-link " href="#generalGraphModuleEccentricity3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleEccentricity3_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._eccentricity({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleEccentricity3_container_collapse" onclick="$('#generalGraphModuleEccentricity3_long').hide(); $('#generalGraphModuleEccentricity3_short').show(); window.location.hash='generalGraphModuleEccentricity3_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleEccentricity3_short" onclick="$('#generalGraphModuleEccentricity3_short').hide(); $('#generalGraphModuleEccentricity3_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._eccentricity({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleEccentricity3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsCloseness1
<div class="example-container" id="generalGraphModuleAbsCloseness1_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsCloseness1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsCloseness1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteCloseness({});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">4</span>
}
</pre>
<div id="generalGraphModuleAbsCloseness1_container_collapse" onclick="$('#generalGraphModuleAbsCloseness1_long').hide(); $('#generalGraphModuleAbsCloseness1_short').show(); window.location.hash='generalGraphModuleAbsCloseness1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsCloseness1_short" onclick="$('#generalGraphModuleAbsCloseness1_short').hide(); $('#generalGraphModuleAbsCloseness1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteCloseness({});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsCloseness1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsCloseness2
<div class="example-container" id="generalGraphModuleAbsCloseness2_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsCloseness2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsCloseness2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteCloseness({}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">4</span>
}
</pre>
<div id="generalGraphModuleAbsCloseness2_container_collapse" onclick="$('#generalGraphModuleAbsCloseness2_long').hide(); $('#generalGraphModuleAbsCloseness2_short').show(); window.location.hash='generalGraphModuleAbsCloseness2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsCloseness2_short" onclick="$('#generalGraphModuleAbsCloseness2_short').hide(); $('#generalGraphModuleAbsCloseness2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteCloseness({}, {<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsCloseness2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsCloseness3
<div class="example-container" id="generalGraphModuleAbsCloseness3_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsCloseness3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsCloseness3_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteCloseness({}, {<span class="hljs-attr">startVertexCollectionRestriction</span> : <span class="hljs-string">'germanCity'</span>,
........&gt; direction : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">3</span>
}
</pre>
<div id="generalGraphModuleAbsCloseness3_container_collapse" onclick="$('#generalGraphModuleAbsCloseness3_long').hide(); $('#generalGraphModuleAbsCloseness3_short').show(); window.location.hash='generalGraphModuleAbsCloseness3_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsCloseness3_short" onclick="$('#generalGraphModuleAbsCloseness3_short').hide(); $('#generalGraphModuleAbsCloseness3_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteCloseness({}, {<span class="hljs-attr">startVertexCollectionRestriction</span> : <span class="hljs-string">'germanCity'</span>,
........&gt; direction : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsCloseness3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCloseness1
<div class="example-container" id="generalGraphModuleCloseness1_container">
<a class="anchorjs-link " href="#generalGraphModuleCloseness1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCloseness1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._closeness();
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleCloseness1_container_collapse" onclick="$('#generalGraphModuleCloseness1_long').hide(); $('#generalGraphModuleCloseness1_short').show(); window.location.hash='generalGraphModuleCloseness1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCloseness1_short" onclick="$('#generalGraphModuleCloseness1_short').hide(); $('#generalGraphModuleCloseness1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._closeness();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCloseness1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCloseness2
<div class="example-container" id="generalGraphModuleCloseness2_container">
<a class="anchorjs-link " href="#generalGraphModuleCloseness2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCloseness2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._closeness({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="generalGraphModuleCloseness2_container_collapse" onclick="$('#generalGraphModuleCloseness2_long').hide(); $('#generalGraphModuleCloseness2_short').show(); window.location.hash='generalGraphModuleCloseness2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCloseness2_short" onclick="$('#generalGraphModuleCloseness2_short').hide(); $('#generalGraphModuleCloseness2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._closeness({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCloseness2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleCloseness3
<div class="example-container" id="generalGraphModuleCloseness3_container">
<a class="anchorjs-link " href="#generalGraphModuleCloseness3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleCloseness3_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._closeness({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">0.25</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">0.5</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">0.3333333333333333</span>
}
</pre>
<div id="generalGraphModuleCloseness3_container_collapse" onclick="$('#generalGraphModuleCloseness3_long').hide(); $('#generalGraphModuleCloseness3_short').show(); window.location.hash='generalGraphModuleCloseness3_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleCloseness3_short" onclick="$('#generalGraphModuleCloseness3_short').hide(); $('#generalGraphModuleCloseness3_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._closeness({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleCloseness3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsBetweenness1
<div class="example-container" id="generalGraphModuleAbsBetweenness1_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsBetweenness1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsBetweenness1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteBetweenness({});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="generalGraphModuleAbsBetweenness1_container_collapse" onclick="$('#generalGraphModuleAbsBetweenness1_long').hide(); $('#generalGraphModuleAbsBetweenness1_short').show(); window.location.hash='generalGraphModuleAbsBetweenness1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleAbsBetweenness1_short" onclick="$('#generalGraphModuleAbsBetweenness1_short').hide(); $('#generalGraphModuleAbsBetweenness1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteBetweenness({});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleAbsBetweenness1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsBetweenness2
<div class="example-container" id="generalGraphModuleAbsBetweenness2_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsBetweenness2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsBetweenness2_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteBetweenness({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
}
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleAbsBetweenness2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleAbsBetweenness3
<div class="example-container" id="generalGraphModuleAbsBetweenness3_container">
<a class="anchorjs-link " href="#generalGraphModuleAbsBetweenness3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleAbsBetweenness3_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._absoluteBetweenness({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
}
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleAbsBetweenness3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleBetweenness1
<div class="example-container" id="generalGraphModuleBetweenness1_container">
<a class="anchorjs-link " href="#generalGraphModuleBetweenness1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleBetweenness1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._betweenness();
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="generalGraphModuleBetweenness1_container_collapse" onclick="$('#generalGraphModuleBetweenness1_long').hide(); $('#generalGraphModuleBetweenness1_short').show(); window.location.hash='generalGraphModuleBetweenness1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleBetweenness1_short" onclick="$('#generalGraphModuleBetweenness1_short').hide(); $('#generalGraphModuleBetweenness1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._betweenness();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleBetweenness1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleBetweenness2
<div class="example-container" id="generalGraphModuleBetweenness2_container">
<a class="anchorjs-link " href="#generalGraphModuleBetweenness2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleBetweenness2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._betweenness({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="generalGraphModuleBetweenness2_container_collapse" onclick="$('#generalGraphModuleBetweenness2_long').hide(); $('#generalGraphModuleBetweenness2_short').show(); window.location.hash='generalGraphModuleBetweenness2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleBetweenness2_short" onclick="$('#generalGraphModuleBetweenness2_short').hide(); $('#generalGraphModuleBetweenness2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._betweenness({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleBetweenness2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleBetweenness3
<div class="example-container" id="generalGraphModuleBetweenness3_container">
<a class="anchorjs-link " href="#generalGraphModuleBetweenness3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleBetweenness3_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._betweenness({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
{
<span class="hljs-string">"frenchCity/Lyon"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"frenchCity/Paris"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Berlin"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Cologne"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"germanCity/Hamburg"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="generalGraphModuleBetweenness3_container_collapse" onclick="$('#generalGraphModuleBetweenness3_long').hide(); $('#generalGraphModuleBetweenness3_short').show(); window.location.hash='generalGraphModuleBetweenness3_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphModuleBetweenness3_short" onclick="$('#generalGraphModuleBetweenness3_short').hide(); $('#generalGraphModuleBetweenness3_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._betweenness({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphModuleBetweenness3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleRadius1
<div class="example-container" id="generalGraphModuleRadius1_container">
<a class="anchorjs-link " href="#generalGraphModuleRadius1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleRadius1_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._radius();
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleRadius1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleRadius2
<div class="example-container" id="generalGraphModuleRadius2_container">
<a class="anchorjs-link " href="#generalGraphModuleRadius2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleRadius2_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._radius({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleRadius2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleRadius3
<div class="example-container" id="generalGraphModuleRadius3_container">
<a class="anchorjs-link " href="#generalGraphModuleRadius3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleRadius3_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._radius({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleRadius3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleDiameter1
<div class="example-container" id="generalGraphModuleDiameter1_container">
<a class="anchorjs-link " href="#generalGraphModuleDiameter1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleDiameter1_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._diameter();
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleDiameter1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleDiameter2
<div class="example-container" id="generalGraphModuleDiameter2_container">
<a class="anchorjs-link " href="#generalGraphModuleDiameter2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleDiameter2_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._diameter({<span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleDiameter2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-functions.md -->
@startDocuBlockInline generalGraphModuleDiameter3
<div class="example-container" id="generalGraphModuleDiameter3_container">
<a class="anchorjs-link " href="#generalGraphModuleDiameter3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphModuleDiameter3_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; graph._diameter({<span class="hljs-attr">direction</span> : <span class="hljs-string">'outbound'</span>, <span class="hljs-attr">weight</span> : <span class="hljs-string">'distance'</span>});
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphModuleDiameter3
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_02_saveUser
<div class="example-container" id="USER_02_saveUser_container">
<a class="anchorjs-link " href="#USER_02_saveUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_02_saveUser_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">'@arangodb/users'</span>).save(<span class="hljs-string">'my-user'</span>, <span class="hljs-string">'my-secret-password'</span>);
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"my-user"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="USER_02_saveUser_container_collapse" onclick="$('#USER_02_saveUser_long').hide(); $('#USER_02_saveUser_short').show(); window.location.hash='USER_02_saveUser_container';" class="example_show_button">Hide execution results</div></div>
<div id="USER_02_saveUser_short" onclick="$('#USER_02_saveUser_short').hide(); $('#USER_02_saveUser_long').show();">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">'@arangodb/users'</span>).save(<span class="hljs-string">'my-user'</span>, <span class="hljs-string">'my-secret-password'</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock USER_02_saveUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_03_replaceUser
<div class="example-container" id="USER_03_replaceUser_container">
<a class="anchorjs-link " href="#USER_03_replaceUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_03_replaceUser_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).replace(<span class="hljs-string">"my-user"</span>, <span class="hljs-string">"my-changed-password"</span>);
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"my-user"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="USER_03_replaceUser_container_collapse" onclick="$('#USER_03_replaceUser_long').hide(); $('#USER_03_replaceUser_short').show(); window.location.hash='USER_03_replaceUser_container';" class="example_show_button">Hide execution results</div></div>
<div id="USER_03_replaceUser_short" onclick="$('#USER_03_replaceUser_short').hide(); $('#USER_03_replaceUser_long').show();">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).replace(<span class="hljs-string">"my-user"</span>, <span class="hljs-string">"my-changed-password"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock USER_03_replaceUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_04_updateUser
<div class="example-container" id="USER_04_updateUser_container">
<a class="anchorjs-link " href="#USER_04_updateUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_04_updateUser_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).update(<span class="hljs-string">"my-user"</span>, <span class="hljs-string">"my-secret-password"</span>);
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"my-user"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="USER_04_updateUser_container_collapse" onclick="$('#USER_04_updateUser_long').hide(); $('#USER_04_updateUser_short').show(); window.location.hash='USER_04_updateUser_container';" class="example_show_button">Hide execution results</div></div>
<div id="USER_04_updateUser_short" onclick="$('#USER_04_updateUser_short').hide(); $('#USER_04_updateUser_long').show();">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).update(<span class="hljs-string">"my-user"</span>, <span class="hljs-string">"my-secret-password"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock USER_04_updateUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_05_isValidUser
<div class="example-container" id="USER_05_isValidUser_container">
<a class="anchorjs-link " href="#USER_05_isValidUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_05_isValidUser_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).isValid(<span class="hljs-string">"my-user"</span>, <span class="hljs-string">"my-secret-password"</span>);
<span class="hljs-literal">true</span>
</pre>
</div>
</div>
@endDocuBlock USER_05_isValidUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_07_removeUser
<div class="example-container" id="USER_07_removeUser_container">
<a class="anchorjs-link " href="#USER_07_removeUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_07_removeUser_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).remove(<span class="hljs-string">"my-user"</span>);
</pre>
</div>
</div>
@endDocuBlock USER_07_removeUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_04_documentUser
<div class="example-container" id="USER_04_documentUser_container">
<a class="anchorjs-link " href="#USER_04_documentUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_04_documentUser_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).document(<span class="hljs-string">"my-user"</span>);
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"my-user"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="USER_04_documentUser_container_collapse" onclick="$('#USER_04_documentUser_long').hide(); $('#USER_04_documentUser_short').show(); window.location.hash='USER_04_documentUser_container';" class="example_show_button">Hide execution results</div></div>
<div id="USER_04_documentUser_short" onclick="$('#USER_04_documentUser_short').hide(); $('#USER_04_documentUser_long').show();">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).document(<span class="hljs-string">"my-user"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock USER_04_documentUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_06_AllUsers
<div class="example-container" id="USER_06_AllUsers_container">
<a class="anchorjs-link " href="#USER_06_AllUsers_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_06_AllUsers_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).all();
[
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"tester"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
}
},
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
}
},
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
}
},
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"my-user"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
}
}
]
</pre>
<div id="USER_06_AllUsers_container_collapse" onclick="$('#USER_06_AllUsers_long').hide(); $('#USER_06_AllUsers_short').show(); window.location.hash='USER_06_AllUsers_container';" class="example_show_button">Hide execution results</div></div>
<div id="USER_06_AllUsers_short" onclick="$('#USER_06_AllUsers_short').hide(); $('#USER_06_AllUsers_long').show();">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).all();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock USER_06_AllUsers
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_03_reloadUser
<div class="example-container" id="USER_03_reloadUser_container">
<a class="anchorjs-link " href="#USER_03_reloadUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_03_reloadUser_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).reload();
</pre>
</div>
</div>
@endDocuBlock USER_03_reloadUser
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-managing-users-in-arangosh.md -->
@startDocuBlockInline USER_05_permission
<div class="example-container" id="USER_05_permission_container">
<a class="anchorjs-link " href="#USER_05_permission_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="USER_05_permission_long">
<pre>
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/users"</span>).permission(<span class="hljs-string">"my-user"</span>, <span class="hljs-string">"testdb"</span>);
rw
</pre>
</div>
</div>
@endDocuBlock USER_05_permission
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_knows_sample
<div class="example-container" id="graph_create_knows_sample_container">
<a class="anchorjs-link " href="#graph_create_knows_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_knows_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"knows_graph"</span>);
arangosh&gt; db.persons.toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fL6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM----"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM---A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM---C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM---E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
arangosh&gt; db.knows.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87660"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/87660"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMC---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87662"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/87662"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMC--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87664"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/87664"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMC--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87666"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/87666"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMC--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87668"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/87668"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMG---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"knows_graph"</span>);
</pre>
<div id="graph_create_knows_sample_container_collapse" onclick="$('#graph_create_knows_sample_long').hide(); $('#graph_create_knows_sample_short').show(); window.location.hash='graph_create_knows_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_knows_sample_short" onclick="$('#graph_create_knows_sample_short').hide(); $('#graph_create_knows_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"knows_graph"</span>);
arangosh&gt; db.persons.toArray()
arangosh&gt; db.knows.toArray();
arangosh&gt; examples.dropGraph(<span class="hljs-string">"knows_graph"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_knows_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_social_sample
<div class="example-container" id="graph_create_social_sample_container">
<a class="anchorjs-link " href="#graph_create_social_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_social_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; db.female.toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"diana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPO--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Diana"</span>
}
]
arangosh&gt; db.male.toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPO--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charly"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPO--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charly"</span>
}
]
arangosh&gt; db.relation.toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87870"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/87870"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPS---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87872"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/87872"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPS--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87874"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/87874"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/charly"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPS--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"charly"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87876"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/87876"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fPS--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"social"</span>);
</pre>
<div id="graph_create_social_sample_container_collapse" onclick="$('#graph_create_social_sample_long').hide(); $('#graph_create_social_sample_short').show(); window.location.hash='graph_create_social_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_social_sample_short" onclick="$('#graph_create_social_sample_short').hide(); $('#graph_create_social_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; db.female.toArray()
arangosh&gt; db.male.toArray()
arangosh&gt; db.relation.toArray()
arangosh&gt; examples.dropGraph(<span class="hljs-string">"social"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_social_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_cities_sample
<div class="example-container" id="graph_create_cities_sample_container">
<a class="anchorjs-link " href="#graph_create_cities_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_cities_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; db.frenchCity.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Lyon"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fKy---"</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">80000</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"geometry"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"Point"</span>,
<span class="hljs-string">"coordinates"</span> : [
<span class="hljs-number">4.84</span>,
<span class="hljs-number">45.76</span>
]
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Paris"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fKy--A"</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">4000000</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"geometry"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"Point"</span>,
<span class="hljs-string">"coordinates"</span> : [
<span class="hljs-number">2.3508</span>,
<span class="hljs-number">48.8567</span>
]
}
}
]
arangosh&gt; db.germanCity.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Berlin"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fKu---"</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">3000000</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"geometry"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"Point"</span>,
<span class="hljs-string">"coordinates"</span> : [
<span class="hljs-number">13.3833</span>,
<span class="hljs-number">52.5167</span>
]
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fKu--A"</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">1000000</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"geometry"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"Point"</span>,
<span class="hljs-string">"coordinates"</span> : [
<span class="hljs-number">6.9528</span>,
<span class="hljs-number">50.9364</span>
]
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Hamburg"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fKu--C"</span>,
<span class="hljs-string">"population"</span> : <span class="hljs-number">1000000</span>,
<span class="hljs-string">"isCapital"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"geometry"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"Point"</span>,
<span class="hljs-string">"coordinates"</span> : [
<span class="hljs-number">10.0014</span>,
<span class="hljs-number">53.5653</span>
]
}
}
]
arangosh&gt; db.germanHighway.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87597"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/87597"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fK2--_"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">850</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87599"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/87599"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fK2--B"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">400</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87601"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"germanHighway/87601"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fK6---"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">500</span>
}
]
arangosh&gt; db.frenchHighway.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87603"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"frenchHighway/87603"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fK6--A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">550</span>
}
]
arangosh&gt; db.internationalHighway.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87605"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/87605"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fL----"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1100</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87607"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/87607"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fL---A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1200</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87609"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/87609"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fL---C"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">900</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87611"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/87611"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Hamburg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fLC---"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1300</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87613"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/87613"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Lyon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fLC--A"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">700</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87615"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"internationalHighway/87615"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"germanCity/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"frenchCity/Paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fLC--C"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">550</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"routeplanner"</span>);
</pre>
<div id="graph_create_cities_sample_container_collapse" onclick="$('#graph_create_cities_sample_long').hide(); $('#graph_create_cities_sample_short').show(); window.location.hash='graph_create_cities_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_cities_sample_short" onclick="$('#graph_create_cities_sample_short').hide(); $('#graph_create_cities_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
arangosh&gt; db.frenchCity.toArray();
arangosh&gt; db.germanCity.toArray();
arangosh&gt; db.germanHighway.toArray();
arangosh&gt; db.frenchHighway.toArray();
arangosh&gt; db.internationalHighway.toArray();
arangosh&gt; examples.dropGraph(<span class="hljs-string">"routeplanner"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_cities_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_traversal_sample
<div class="example-container" id="graph_create_traversal_sample_container">
<a class="anchorjs-link " href="#graph_create_traversal_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_traversal_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"traversalGraph"</span>);
arangosh&gt; db.circles.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"A"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/A"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fP6---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"B"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fP6--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"2"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"C"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fP6--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"D"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/D"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fP6--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"4"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"E"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/E"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fP6--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"F"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/F"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQ----"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"6"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"G"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQ---A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"7"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"H"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/H"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQ---C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"8"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"I"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/I"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQ---E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"9"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"J"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/J"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQ---G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"10"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"K"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/K"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQC---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"11"</span>
}
]
arangosh&gt; db.edges.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87919"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87919"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQC--A"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_bar"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87921"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87921"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQC--C"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_blarg"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87923"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87923"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/C"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/D"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQC--E"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_blorg"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87925"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87925"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/E"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQG---"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_blub"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87927"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87927"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/E"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/F"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQG--A"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_schubi"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87929"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87929"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQG--C"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_foo"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87931"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87931"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/H"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQG--E"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_blob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87933"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87933"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/H"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/I"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQG--G"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_blub"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87935"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87935"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/J"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQK---"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_zip"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87937"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/87937"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/J"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/K"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fQK--A"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_zup"</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"traversalGraph"</span>);
</pre>
<div id="graph_create_traversal_sample_container_collapse" onclick="$('#graph_create_traversal_sample_long').hide(); $('#graph_create_traversal_sample_short').show(); window.location.hash='graph_create_traversal_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_traversal_sample_short" onclick="$('#graph_create_traversal_sample_short').hide(); $('#graph_create_traversal_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"traversalGraph"</span>);
arangosh&gt; db.circles.toArray();
arangosh&gt; db.edges.toArray();
arangosh&gt; examples.dropGraph(<span class="hljs-string">"traversalGraph"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_traversal_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_kshortestpaths_sample
<div class="example-container" id="graph_create_kshortestpaths_sample_container">
<a class="anchorjs-link " href="#graph_create_kshortestpaths_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_kshortestpaths_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
arangosh&gt; db.places.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Inverness"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Inverness"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMm---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Inverness"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMm--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Aberdeen"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMq---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Leuchars"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"StAndrews"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/StAndrews"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMq--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"StAndrews"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMq--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Edinburgh"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Glasgow"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMq--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Glasgow"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"York"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMq--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"York"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Carlisle"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMu---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Carlisle"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Birmingham"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMu--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Birmingham"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"London"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMu--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"London"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Brussels"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMu--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Brussels"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMu--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Cologne"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Toronto"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Toronto"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMy---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Toronto"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Winnipeg"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMy--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Winnipeg"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Saskatoon"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMy--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Saskatoon"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Edmonton"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMy--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Edmonton"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Jasper"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fMy--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Jasper"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Vancouver"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Vancouver"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM2---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Vancouver"</span>
}
]
arangosh&gt; db.connections.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87714"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87714"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Inverness"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM2--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87716"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87716"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Inverness"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM2--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87718"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87718"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM2--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87720"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87720"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM6---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87722"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87722"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM6--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87724"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87724"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM6--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87726"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87726"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM6--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87728"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87728"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fM6--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87730"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87730"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fN----"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87732"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87732"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fN---A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">4</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87734"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87734"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fN---C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87736"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87736"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fN---E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87738"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87738"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNC---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87740"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87740"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNC--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87742"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87742"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNC--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87744"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87744"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNC--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87746"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87746"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNC--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87748"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87748"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNG---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87750"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87750"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/StAndrews"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNG--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">0.2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87752"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87752"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/StAndrews"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNG--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">0.2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87754"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87754"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNG--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.8</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87756"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87756"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNK---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87758"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87758"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNK--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87760"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87760"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNO---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87762"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87762"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNO--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87764"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87764"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNO--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87766"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87766"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Toronto"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNO--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">36</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87768"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87768"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Toronto"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNO--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">35</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87770"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87770"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNS---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">12</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87772"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87772"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNS--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87774"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87774"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNS--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">12</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87776"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87776"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNS--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">17</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87778"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87778"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNW---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">6</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87780"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87780"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNW--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87782"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87782"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Vancouver"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNW--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">12</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87784"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/87784"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Vancouver"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fNW--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">13</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
</pre>
<div id="graph_create_kshortestpaths_sample_container_collapse" onclick="$('#graph_create_kshortestpaths_sample_long').hide(); $('#graph_create_kshortestpaths_sample_short').show(); window.location.hash='graph_create_kshortestpaths_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_kshortestpaths_sample_short" onclick="$('#graph_create_kshortestpaths_sample_short').hide(); $('#graph_create_kshortestpaths_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
arangosh&gt; db.places.toArray();
arangosh&gt; db.connections.toArray();
arangosh&gt; examples.dropGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_kshortestpaths_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_world_sample
<div class="example-container" id="graph_create_world_sample_container">
<a class="anchorjs-link " href="#graph_create_world_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_world_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"worldCountry"</span>);
arangosh&gt; db.worldVertices.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"world"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"World"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"root"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"continent-africa"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Africa"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"continent"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"continent-asia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRC--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Asia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"continent"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"continent-australia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/continent-australia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRC--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Australia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"continent"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"continent-europe"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRC--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Europe"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"continent"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"continent-north-america"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/continent-north-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"North America"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"continent"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"continent-south-america"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"South America"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"continent"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-afghanistan"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-afghanistan"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Afghanistan"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"AFG"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-albania"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-albania"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRG--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Albania"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"ALB"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-algeria"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-algeria"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Algeria"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"DZA"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-andorra"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-andorra"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRK--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Andorra"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"AND"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-angola"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-angola"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRK--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angola"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"AGO"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-antigua-and-barbuda"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-antigua-and-barbuda"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRK--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Antigua and Barbuda"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"ATG"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-argentina"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-argentina"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRK--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Argentina"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"ARG"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-australia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-australia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRK--I"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Australia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"AUS"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-austria"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-austria"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Austria"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"AUT"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bahamas"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bahamas"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRO--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bahamas"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BHS"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bahrain"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bahrain"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRO--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bahrain"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BHR"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bangladesh"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bangladesh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRO--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bangladesh"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BGD"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-barbados"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-barbados"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRO--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Barbados"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BRB"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-belgium"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-belgium"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Belgium"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BEL"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bhutan"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bhutan"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bhutan"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BTN"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bolivia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bolivia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRS--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bolivia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BOL"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bosnia-and-herzegovina"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bosnia-and-herzegovina"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRS--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bosnia and Herzegovina"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BIH"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-botswana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-botswana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRS--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Botswana"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BWA"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-brazil"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-brazil"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRW---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Brazil"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BRA"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-brunei"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-brunei"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRW--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Brunei"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BRN"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-bulgaria"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-bulgaria"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRW--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bulgaria"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BGR"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-burkina-faso"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-burkina-faso"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRW--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Burkina Faso"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BFA"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-burundi"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-burundi"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRW--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Burundi"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"BDI"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-cambodia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-cambodia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRW--I"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Cambodia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"KHM"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-cameroon"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-cameroon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRa---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Cameroon"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"CMR"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-canada"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-canada"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRa--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Canada"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"CAN"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-chad"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-chad"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRa--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Chad"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"TCD"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-chile"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-chile"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRa--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Chile"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"CHL"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-colombia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-colombia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRa--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Colombia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"COL"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-cote-d-ivoire"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-cote-d-ivoire"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Cote d'Ivoire"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"CIV"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-croatia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-croatia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Croatia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"HRV"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-czech-republic"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-czech-republic"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRe--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Czech Republic"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"CZE"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-denmark"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-denmark"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRe--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Denmark"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"DNK"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-ecuador"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-ecuador"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRe--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Ecuador"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"ECU"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-egypt"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-egypt"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Egypt"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"EGY"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-eritrea"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-eritrea"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eritrea"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"ERI"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-finland"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-finland"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Finland"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"FIN"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-france"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-france"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"France"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"FRA"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-germany"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-germany"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRi--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Germany"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"DEU"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"country-people-s-republic-of-china"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/country-people-s-republic-of-china"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRi--I"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"People's Republic of China"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"country"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"CHN"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-algiers"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-algiers"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRm---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Algiers"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-andorra-la-vella"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-andorra-la-vella"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRm--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Andorra la Vella"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-asmara"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-asmara"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRm--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Asmara"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-bandar-seri-begawan"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-bandar-seri-begawan"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRm--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bandar Seri Begawan"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-beijing"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-beijing"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRm--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Beijing"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-berlin"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-berlin"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRq---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Berlin"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-bogota"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-bogota"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRq--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bogota"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-brasilia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-brasilia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRq--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Brasilia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-bridgetown"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-bridgetown"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRq--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bridgetown"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-brussels"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRq--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Brussels"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-buenos-aires"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-buenos-aires"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRu---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Buenos Aires"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-bujumbura"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-bujumbura"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRu--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bujumbura"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-cairo"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-cairo"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRu--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Cairo"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-canberra"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-canberra"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRu--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Canberra"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-copenhagen"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-copenhagen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRu--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Copenhagen"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-dhaka"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-dhaka"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRu--I"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dhaka"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-gaborone"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-gaborone"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Gaborone"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-helsinki"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-helsinki"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRy--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Helsinki"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-kabul"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-kabul"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRy--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Kabul"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-la-paz"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-la-paz"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRy--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"La Paz"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-luanda"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-luanda"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fRy--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Luanda"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-manama"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-manama"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Manama"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-nassau"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-nassau"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Nassau"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-n-djamena"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-n-djamena"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR2--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"N'Djamena"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-ottawa"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-ottawa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR2--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Ottawa"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-ouagadougou"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-ouagadougou"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR2--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Ouagadougou"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-paris"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-paris"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR2--I"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Paris"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-phnom-penh"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-phnom-penh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Phnom Penh"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-prague"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-prague"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR6--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Prague"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-quito"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-quito"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR6--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Quito"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-saint-john-s"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-saint-john-s"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR6--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Saint John's"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-santiago"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-santiago"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fR6--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Santiago"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-sarajevo"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-sarajevo"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS----"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Sarajevo"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-sofia"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-sofia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS---A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Sofia"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-thimphu"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-thimphu"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS---C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Thimphu"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-tirana"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-tirana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS---E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Tirana"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-vienna"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-vienna"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS---G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Vienna"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-yamoussoukro"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-yamoussoukro"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS---I"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Yamoussoukro"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-yaounde"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-yaounde"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Yaounde"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"capital-zagreb"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldVertices/capital-zagreb"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Zagreb"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"capital"</span>
}
]
arangosh&gt; db.worldEdges.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88052"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88052"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSC--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88054"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88054"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSC--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88056"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88056"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/continent-australia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSC--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88058"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88058"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSG---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88060"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88060"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/continent-north-america"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSG--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88062"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88062"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/world"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSG--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88064"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88064"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-afghanistan"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSG--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88066"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88066"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-albania"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSK---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88068"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88068"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-algeria"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSK--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88070"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88070"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-andorra"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSK--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88072"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88072"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-angola"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSK--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88074"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88074"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-antigua-and-barbuda"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-north-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSK--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88076"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88076"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-argentina"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSO---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88078"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88078"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-australia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-australia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSO--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88080"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88080"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-austria"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSO--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88082"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88082"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bahamas"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-north-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSS---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88084"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88084"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bahrain"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSS--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88086"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88086"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bangladesh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSS--D"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88088"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88088"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-barbados"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-north-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSW---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88090"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88090"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-belgium"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSW--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88092"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88092"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bhutan"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSW--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88094"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88094"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bolivia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSW--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88096"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88096"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bosnia-and-herzegovina"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSW--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88098"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88098"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-botswana"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSa---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88100"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88100"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-brazil"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSa--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88102"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88102"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-brunei"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSa--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88104"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88104"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-bulgaria"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSa--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88106"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88106"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-burkina-faso"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSa--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88108"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88108"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-burundi"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSe---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88110"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88110"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-cambodia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSe--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88112"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88112"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-cameroon"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSe--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88114"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88114"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-canada"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-north-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSe--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88116"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88116"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-chad"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSe--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88118"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88118"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-chile"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSi---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88120"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88120"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-colombia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSi--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88122"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88122"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-cote-d-ivoire"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSi--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88124"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88124"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-croatia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSi--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88126"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88126"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-czech-republic"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSi--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88128"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88128"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-denmark"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSm---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88130"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88130"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-ecuador"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-south-america"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSm--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88132"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88132"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-egypt"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSm--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88134"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88134"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-eritrea"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-africa"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSm--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88136"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88136"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-finland"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSm--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88138"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88138"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-france"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSq---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88140"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88140"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-germany"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-europe"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSq--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88142"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88142"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/country-people-s-republic-of-china"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/continent-asia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSq--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88144"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88144"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-algiers"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-algeria"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSq--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88146"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88146"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-andorra-la-vella"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-andorra"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSq--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88148"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88148"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-asmara"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-eritrea"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSu---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88150"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88150"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-bandar-seri-begawan"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-brunei"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSu--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88152"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88152"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-beijing"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-people-s-republic-of-china"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSu--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88154"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88154"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-berlin"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-germany"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSu--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88156"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88156"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-bogota"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-colombia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSu--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88158"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88158"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-brasilia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-brazil"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSy---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88160"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88160"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-bridgetown"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-barbados"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSy--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88162"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88162"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-brussels"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-belgium"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSy--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88164"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88164"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-buenos-aires"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-argentina"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSy--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88166"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88166"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-bujumbura"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-burundi"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fSy--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88168"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88168"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-cairo"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-egypt"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS2---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88170"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88170"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-canberra"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-australia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS2--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88172"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88172"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-copenhagen"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-denmark"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS2--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88174"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88174"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-dhaka"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bangladesh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS2--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88176"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88176"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-gaborone"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-botswana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS2--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88178"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88178"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-helsinki"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-finland"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS6---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88180"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88180"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-kabul"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-afghanistan"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS6--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88182"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88182"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-la-paz"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bolivia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS6--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88184"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88184"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-luanda"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-angola"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS6--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88186"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88186"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-manama"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bahrain"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fS6--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88188"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88188"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-nassau"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bahamas"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fT----"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88190"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88190"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-n-djamena"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-chad"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fT---A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88192"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88192"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-ottawa"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-canada"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fT---C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88194"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88194"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-ouagadougou"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-burkina-faso"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fT---E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88196"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88196"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-paris"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-france"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fT---G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88198"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88198"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-phnom-penh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-cambodia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTC---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88200"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88200"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-prague"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-czech-republic"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTC--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88202"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88202"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-quito"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-ecuador"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTC--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88204"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88204"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-saint-john-s"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-antigua-and-barbuda"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTC--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88206"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88206"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-santiago"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-chile"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTC--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88208"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88208"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-sarajevo"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bosnia-and-herzegovina"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTG---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88210"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88210"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-sofia"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bulgaria"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTG--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88212"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88212"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-thimphu"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-bhutan"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTG--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88214"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88214"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-tirana"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-albania"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTG--E"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88216"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88216"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-vienna"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-austria"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTG--G"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88218"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88218"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-yamoussoukro"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-cote-d-ivoire"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTK---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88220"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88220"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-yaounde"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-cameroon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTK--A"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88222"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"worldEdges/88222"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"worldVertices/capital-zagreb"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"worldVertices/country-croatia"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fTK--C"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"is-in"</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"worldCountry"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"worldCountryUnManaged"</span>);
arangosh&gt; examples.dropGraph(<span class="hljs-string">"worldCountryUnManaged"</span>);
</pre>
<div id="graph_create_world_sample_container_collapse" onclick="$('#graph_create_world_sample_long').hide(); $('#graph_create_world_sample_short').show(); window.location.hash='graph_create_world_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_world_sample_short" onclick="$('#graph_create_world_sample_short').hide(); $('#graph_create_world_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"worldCountry"</span>);
arangosh&gt; db.worldVertices.toArray();
arangosh&gt; db.worldEdges.toArray();
arangosh&gt; examples.dropGraph(<span class="hljs-string">"worldCountry"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"worldCountryUnManaged"</span>);
arangosh&gt; examples.dropGraph(<span class="hljs-string">"worldCountryUnManaged"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_world_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs.md -->
@startDocuBlockInline graph_create_mps_sample
<div class="example-container" id="graph_create_mps_sample_container">
<a class="anchorjs-link " href="#graph_create_mps_sample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="graph_create_mps_sample_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"mps_graph"</span>);
arangosh&gt; db.mps_verts.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"A"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_verts/A"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOe---"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"B"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_verts/B"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOe--A"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"C"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_verts/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOe--C"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"D"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_verts/D"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOe--E"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"E"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_verts/E"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOe--G"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"F"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_verts/F"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOe--I"</span>
}
]
arangosh&gt; db.mps_edges.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/B"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOi---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"A"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87820"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87820"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/E"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOi--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"A"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87822"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87822"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/D"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOi--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"A"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/B"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"B"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/D"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOi--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"D"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87828"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87828"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/E"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/F"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOm---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"E"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"87830"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mps_edges/87830"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"mps_verts/F"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"mps_verts/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fOm--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"F"</span>
}
]
arangosh&gt; examples.dropGraph(<span class="hljs-string">"mps_graph"</span>);
</pre>
<div id="graph_create_mps_sample_container_collapse" onclick="$('#graph_create_mps_sample_long').hide(); $('#graph_create_mps_sample_short').show(); window.location.hash='graph_create_mps_sample_container';" class="example_show_button">Hide execution results</div></div>
<div id="graph_create_mps_sample_short" onclick="$('#graph_create_mps_sample_short').hide(); $('#graph_create_mps_sample_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"mps_graph"</span>);
arangosh&gt; db.mps_verts.toArray();
arangosh&gt; db.mps_edges.toArray();
arangosh&gt; examples.dropGraph(<span class="hljs-string">"mps_graph"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock graph_create_mps_sample
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-details.md -->
@startDocuBlockInline shellPaste
<div class="example-container" id="shellPaste_container">
<a class="anchorjs-link " href="#shellPaste_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="shellPaste_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; i ++) {
........&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).print(<span class="hljs-string">"Hello world "</span> + i + <span class="hljs-string">"!\n"</span>);
........&gt; }
Hello world <span class="hljs-number">0</span>!
Hello world <span class="hljs-number">1</span>!
Hello world <span class="hljs-number">2</span>!
Hello world <span class="hljs-number">3</span>!
Hello world <span class="hljs-number">4</span>!
Hello world <span class="hljs-number">5</span>!
Hello world <span class="hljs-number">6</span>!
Hello world <span class="hljs-number">7</span>!
Hello world <span class="hljs-number">8</span>!
Hello world <span class="hljs-number">9</span>!
</pre>
<div id="shellPaste_container_collapse" onclick="$('#shellPaste_long').hide(); $('#shellPaste_short').show(); window.location.hash='shellPaste_container';" class="example_show_button">Hide execution results</div></div>
<div id="shellPaste_short" onclick="$('#shellPaste_short').hide(); $('#shellPaste_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; i ++) {
........&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).print(<span class="hljs-string">"Hello world "</span> + i + <span class="hljs-string">"!\n"</span>);
........&gt; }
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock shellPaste
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-details.md -->
@startDocuBlockInline lastExpressionResult
<div class="example-container" id="lastExpressionResult_container">
<a class="anchorjs-link " href="#lastExpressionResult_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="lastExpressionResult_long">
<pre>
arangosh&gt; <span class="hljs-number">42</span> * <span class="hljs-number">23</span>
<span class="hljs-number">966</span>
</pre>
</div>
</div>
@endDocuBlock lastExpressionResult
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-details.md -->
@startDocuBlockInline lastExpressionResultCaptured
<div class="example-container" id="lastExpressionResultCaptured_container">
<a class="anchorjs-link " href="#lastExpressionResultCaptured_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="lastExpressionResultCaptured_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> calculationResult = <span class="hljs-number">42</span> * <span class="hljs-number">23</span>
</pre>
</div>
</div>
@endDocuBlock lastExpressionResultCaptured
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-details.md -->
@startDocuBlockInline printFunction
<div class="example-container" id="printFunction_container">
<a class="anchorjs-link " href="#printFunction_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="printFunction_long" style="Display: none;">
<pre>
arangosh&gt; print({ <span class="hljs-attr">a</span>: <span class="hljs-string">"123"</span>, <span class="hljs-attr">b</span>: [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>], <span class="hljs-attr">c</span>: <span class="hljs-string">"test"</span> });
{
<span class="hljs-string">"a"</span> : <span class="hljs-string">"123"</span>,
<span class="hljs-string">"b"</span> : [
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
],
<span class="hljs-string">"c"</span> : <span class="hljs-string">"test"</span>
}
</pre>
<div id="printFunction_container_collapse" onclick="$('#printFunction_long').hide(); $('#printFunction_short').show(); window.location.hash='printFunction_container';" class="example_show_button">Hide execution results</div></div>
<div id="printFunction_short" onclick="$('#printFunction_short').hide(); $('#printFunction_long').show();">
<pre>
arangosh&gt; print({ <span class="hljs-attr">a</span>: <span class="hljs-string">"123"</span>, <span class="hljs-attr">b</span>: [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>], <span class="hljs-attr">c</span>: <span class="hljs-string">"test"</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock printFunction
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-details.md -->
@startDocuBlockInline usingToArray
<div class="example-container" id="usingToArray_container">
<a class="anchorjs-link " href="#usingToArray_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="usingToArray_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"five"</span>)
[ArangoCollection <span class="hljs-number">88677</span>, <span class="hljs-string">"five"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">5</span>; i++) db.five.save({<span class="hljs-attr">value</span>:i})
arangosh&gt; db.five.toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88682"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88682"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ghO---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88684"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88684"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ghO--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88686"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88686"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ghO--C"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88688"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88688"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ghS---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88690"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88690"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ghS--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">4</span>
}
]
</pre>
<div id="usingToArray_container_collapse" onclick="$('#usingToArray_long').hide(); $('#usingToArray_short').show(); window.location.hash='usingToArray_container';" class="example_show_button">Hide execution results</div></div>
<div id="usingToArray_short" onclick="$('#usingToArray_short').hide(); $('#usingToArray_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"five"</span>)
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">5</span>; i++) db.five.save({<span class="hljs-attr">value</span>:i})
arangosh&gt; db.five.toArray()
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock usingToArray
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/programs-arangosh-details.md -->
@startDocuBlockInline shellHelp
<div class="example-container" id="shellHelp_container">
<a class="anchorjs-link " href="#shellHelp_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="shellHelp_long" style="Display: none;">
<pre>
arangosh&gt; db._help();
--------------------------- ArangoDatabase (db) help ---------------------------
Administration Functions:
_help() <span class="hljs-keyword">this</span> help
_flushCache() flush and refill collection cache
Collection Functions:
_collections() list all collections
_collection(&lt;name&gt;) get collection by identifier/name
_create(&lt;name&gt;, &lt;properties&gt;) creates a new collection
_createEdgeCollection(&lt;name&gt;) creates a new edge collection
_drop(&lt;name&gt;) delete a collection
Document Functions:
_document(&lt;id&gt;) get document by handle (_id)
_replace(&lt;id&gt;, &lt;data&gt;, &lt;overwrite&gt;) overwrite document
_update(&lt;id&gt;, &lt;data&gt;, &lt;overwrite&gt;, partially update document
&lt;keepNull&gt;)
_remove(&lt;id&gt;) delete document
_exists(&lt;id&gt;) checks whether a document exists
_truncate() delete all documents
Database Management Functions:
_createDatabase(&lt;name&gt;) creates a new database
_dropDatabase(&lt;name&gt;) drops an existing database
_useDatabase(&lt;name&gt;) switches into an existing database
_drop(&lt;name&gt;) delete a collection
_name() name of the current database
Query / Transaction Functions:
_executeTransaction(&lt;transaction&gt;) execute transaction
_query(&lt;query&gt;) execute AQL query
_createStatement(&lt;data&gt;) create and return AQL query
View Functions:
_views() list all views
_view(&lt;name&gt;) get view by name
_createView(&lt;name&gt;, &lt;type&gt;, creates a new view
&lt;properties&gt;)
_dropView(&lt;name&gt;) delete a view
</pre>
<div id="shellHelp_container_collapse" onclick="$('#shellHelp_long').hide(); $('#shellHelp_short').show(); window.location.hash='shellHelp_container';" class="example_show_button">Hide execution results</div></div>
<div id="shellHelp_short" onclick="$('#shellHelp_short').hide(); $('#shellHelp_long').show();">
<pre>
arangosh&gt; db._help();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock shellHelp
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-persistent.md -->
@startDocuBlockInline ensureUniquePersistentSingle
<div class="example-container" id="ensureUniquePersistentSingle_container">
<a class="anchorjs-link " href="#ensureUniquePersistentSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureUniquePersistentSingle_long" style="Display: none;">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"persistent"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"myId"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"myId"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"ids/74816"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081992818690"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74820"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74820"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXy---"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">456</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74822"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74822"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXy--A"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">789</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74824"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74824"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXy--C"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
[ArangoError <span class="hljs-number">1210</span>: unique constraint violated - <span class="hljs-keyword">in</span> index idx_1646382081992818690 <span class="hljs-keyword">of</span> type persistent over <span class="hljs-string">'myId'</span>; conflicting key: <span class="hljs-number">74820</span>]
</pre>
<div id="ensureUniquePersistentSingle_container_collapse" onclick="$('#ensureUniquePersistentSingle_long').hide(); $('#ensureUniquePersistentSingle_short').show(); window.location.hash='ensureUniquePersistentSingle_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureUniquePersistentSingle_short" onclick="$('#ensureUniquePersistentSingle_short').hide(); $('#ensureUniquePersistentSingle_long').show();">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"persistent"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"myId"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">456</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">789</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureUniquePersistentSingle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-persistent.md -->
@startDocuBlockInline ensureUniquePersistentMultiColmun
<div class="example-container" id="ensureUniquePersistentMultiColmun_container">
<a class="anchorjs-link " href="#ensureUniquePersistentMultiColmun_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureUniquePersistentMultiColmun_long" style="Display: none;">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"persistent"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"name.first"</span>, <span class="hljs-string">"name.last"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"name.first"</span>,
<span class="hljs-string">"name.last"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"ids/74797"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081988624384"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74801"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74801"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXe--_"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"jens"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74803"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74803"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXe--B"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74805"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74805"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dXi---"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
[ArangoError <span class="hljs-number">1210</span>: unique constraint violated - <span class="hljs-keyword">in</span> index idx_1646382081988624384 <span class="hljs-keyword">of</span> type persistent over <span class="hljs-string">'name.first, name.last'</span>; conflicting key: <span class="hljs-number">74801</span>]
</pre>
<div id="ensureUniquePersistentMultiColmun_container_collapse" onclick="$('#ensureUniquePersistentMultiColmun_long').hide(); $('#ensureUniquePersistentMultiColmun_short').show(); window.location.hash='ensureUniquePersistentMultiColmun_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureUniquePersistentMultiColmun_short" onclick="$('#ensureUniquePersistentMultiColmun_short').hide(); $('#ensureUniquePersistentMultiColmun_long').show();">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"persistent"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"name.first"</span>, <span class="hljs-string">"name.last"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"jens"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureUniquePersistentMultiColmun
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-persistent.md -->
@startDocuBlockInline ensurePersistent
<div class="example-container" id="ensurePersistent_container">
<a class="anchorjs-link " href="#ensurePersistent_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensurePersistent_long" style="Display: none;">
<pre>
arangosh&gt; db.names.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"persistent"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"first"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"first"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"names/74508"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081944584194"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74512"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74512"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU2--B"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74514"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74514"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU6---"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"John"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74516"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74516"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU6--A"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74518"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74518"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dU6--C"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74520"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74520"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dV----"</span>
}
</pre>
<div id="ensurePersistent_container_collapse" onclick="$('#ensurePersistent_long').hide(); $('#ensurePersistent_short').show(); window.location.hash='ensurePersistent_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensurePersistent_short" onclick="$('#ensurePersistent_short').hide(); $('#ensurePersistent_long').show();">
<pre>
arangosh&gt; db.names.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"persistent"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"first"</span> ] });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"John"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensurePersistent
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-geo.md -->
@startDocuBlockInline geoIndexCreateForArrayAttribute1
<div class="example-container" id="geoIndexCreateForArrayAttribute1_container">
<a class="anchorjs-link " href="#geoIndexCreateForArrayAttribute1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="geoIndexCreateForArrayAttribute1_long" style="Display: none;">
<pre>
arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"loc"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"geo/80446"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382083135766530"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">loc</span>: [ i, j ] });
........&gt; }
........&gt; }
arangosh&gt; db.geo.count();
<span class="hljs-number">703</span>
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">3</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"81152"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/81152"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6egS--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"81226"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/81226"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6egu--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/0"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">0</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"81154"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/81154"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6egS--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/10"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">10</span>
]
}
]
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).count();
<span class="hljs-literal">null</span>
</pre>
<div id="geoIndexCreateForArrayAttribute1_container_collapse" onclick="$('#geoIndexCreateForArrayAttribute1_long').hide(); $('#geoIndexCreateForArrayAttribute1_short').show(); window.location.hash='geoIndexCreateForArrayAttribute1_container';" class="example_show_button">Hide execution results</div></div>
<div id="geoIndexCreateForArrayAttribute1_short" onclick="$('#geoIndexCreateForArrayAttribute1_short').hide(); $('#geoIndexCreateForArrayAttribute1_long').show();">
<pre>
arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">loc</span>: [ i, j ] });
........&gt; }
........&gt; }
arangosh&gt; db.geo.count();
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">3</span>).toArray();
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).count();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock geoIndexCreateForArrayAttribute1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-geo.md -->
@startDocuBlockInline geoIndexCreateForArrayAttribute2
<div class="example-container" id="geoIndexCreateForArrayAttribute2_container">
<a class="anchorjs-link " href="#geoIndexCreateForArrayAttribute2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="geoIndexCreateForArrayAttribute2_long" style="Display: none;">
<pre>
arangosh&gt; db.geo2.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"location.latitude"</span>, <span class="hljs-string">"location.longitude"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"location.latitude"</span>,
<span class="hljs-string">"location.longitude"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"geo2/81872"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382083298295808"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo2.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">location</span>: { <span class="hljs-attr">latitude</span> : i, <span class="hljs-attr">longitude</span> : j } });
........&gt; }
........&gt; }
arangosh&gt; db.geo2.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">3</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"82578"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo2/82578"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ep2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"location"</span> : {
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"82652"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo2/82652"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eqS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/0"</span>,
<span class="hljs-string">"location"</span> : {
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>
}
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"82580"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo2/82580"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ep2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/10"</span>,
<span class="hljs-string">"location"</span> : {
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">10</span>
}
}
]
</pre>
<div id="geoIndexCreateForArrayAttribute2_container_collapse" onclick="$('#geoIndexCreateForArrayAttribute2_long').hide(); $('#geoIndexCreateForArrayAttribute2_short').show(); window.location.hash='geoIndexCreateForArrayAttribute2_container';" class="example_show_button">Hide execution results</div></div>
<div id="geoIndexCreateForArrayAttribute2_short" onclick="$('#geoIndexCreateForArrayAttribute2_short').hide(); $('#geoIndexCreateForArrayAttribute2_long').show();">
<pre>
arangosh&gt; db.geo2.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"location.latitude"</span>, <span class="hljs-string">"location.longitude"</span> ] });
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo2.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">location</span>: { <span class="hljs-attr">latitude</span> : i, <span class="hljs-attr">longitude</span> : j } });
........&gt; }
........&gt; }
arangosh&gt; db.geo2.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">3</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock geoIndexCreateForArrayAttribute2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-geo.md -->
@startDocuBlockInline geoIndexSortOptimization
<div class="example-container" id="geoIndexSortOptimization_container">
<a class="anchorjs-link " href="#geoIndexSortOptimization_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="geoIndexSortOptimization_long" style="Display: none;">
<pre>
arangosh&gt; db.geoSort.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"latitude"</span>, <span class="hljs-string">"longitude"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"latitude"</span>,
<span class="hljs-string">"longitude"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"geoSort/86143"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382083762814978"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geoSort.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">latitude</span> : i, <span class="hljs-attr">longitude</span> : j });
........&gt; }
........&gt; }
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc in geoSort SORT DISTANCE(doc.latitude, doc.longitude, 0, 0) LIMIT 5 RETURN doc"</span>
arangosh&gt; db._explain(query, {}, {<span class="hljs-attr">colors</span>: <span class="hljs-literal">false</span>});
Query <span class="hljs-built_in">String</span> (<span class="hljs-number">86</span> chars, <span class="hljs-attr">cacheable</span>: <span class="hljs-literal">true</span>):
FOR doc <span class="hljs-keyword">in</span> geoSort SORT DISTANCE(doc.latitude, doc.longitude, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>) LIMIT <span class="hljs-number">5</span> RETURN doc
Execution plan:
Id NodeType Est. Comment
<span class="hljs-number">1</span> SingletonNode <span class="hljs-number">1</span> * ROOT
<span class="hljs-number">7</span> IndexNode <span class="hljs-number">703</span> - FOR doc IN geoSort <span class="hljs-comment">/* geo index scan */</span>
<span class="hljs-number">5</span> LimitNode <span class="hljs-number">5</span> - LIMIT <span class="hljs-number">0</span>, <span class="hljs-number">5</span>
<span class="hljs-number">6</span> ReturnNode <span class="hljs-number">5</span> - RETURN doc
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
<span class="hljs-number">7</span> idx_1646382083762814978 geo geoSort <span class="hljs-literal">false</span> <span class="hljs-literal">true</span> n/a [ <span class="hljs-string">`latitude`</span>, <span class="hljs-string">`longitude`</span> ] (GEO_DISTANCE([ <span class="hljs-number">0</span>, <span class="hljs-number">0</span> ], [ doc.<span class="hljs-string">`longitude`</span>, doc.<span class="hljs-string">`latitude`</span> ]) &lt; <span class="hljs-string">"unlimited"</span>)
Optimization rules applied:
Id RuleName
<span class="hljs-number">1</span> geo-index-optimizer
<span class="hljs-number">2</span> remove-unnecessary-calculations<span class="hljs-number">-2</span>
arangosh&gt; db._query(query);
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"86849"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geoSort/86849"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fFi--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"86923"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geoSort/86923"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fGC--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/0"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"86851"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geoSort/86851"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fFm---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/10"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">10</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"86775"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geoSort/86775"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fFG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/0"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">-10</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"86847"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geoSort/86847"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6fFi--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/-10"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">-10</span>
}
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">5</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="geoIndexSortOptimization_container_collapse" onclick="$('#geoIndexSortOptimization_long').hide(); $('#geoIndexSortOptimization_short').show(); window.location.hash='geoIndexSortOptimization_container';" class="example_show_button">Hide execution results</div></div>
<div id="geoIndexSortOptimization_short" onclick="$('#geoIndexSortOptimization_short').hide(); $('#geoIndexSortOptimization_long').show();">
<pre>
arangosh&gt; db.geoSort.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"latitude"</span>, <span class="hljs-string">"longitude"</span> ] });
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geoSort.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">latitude</span> : i, <span class="hljs-attr">longitude</span> : j });
........&gt; }
........&gt; }
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc in geoSort SORT DISTANCE(doc.latitude, doc.longitude, 0, 0) LIMIT 5 RETURN doc"</span>
arangosh&gt; db._explain(query, {}, {<span class="hljs-attr">colors</span>: <span class="hljs-literal">false</span>});
arangosh&gt; db._query(query);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock geoIndexSortOptimization
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-geo.md -->
@startDocuBlockInline geoIndexFilterOptimization
<div class="example-container" id="geoIndexFilterOptimization_container">
<a class="anchorjs-link " href="#geoIndexFilterOptimization_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="geoIndexFilterOptimization_long" style="Display: none;">
<pre>
arangosh&gt; db.geoFilter.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"latitude"</span>, <span class="hljs-string">"longitude"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"latitude"</span>,
<span class="hljs-string">"longitude"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"geoFilter/83293"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382083452436480"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geoFilter.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">latitude</span> : i, <span class="hljs-attr">longitude</span> : j });
........&gt; }
........&gt; }
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc in geoFilter FILTER DISTANCE(doc.latitude, doc.longitude, 0, 0) &lt; 2000 RETURN doc"</span>
arangosh&gt; db._explain(query, {}, {<span class="hljs-attr">colors</span>: <span class="hljs-literal">false</span>});
Query <span class="hljs-built_in">String</span> (<span class="hljs-number">89</span> chars, <span class="hljs-attr">cacheable</span>: <span class="hljs-literal">true</span>):
FOR doc <span class="hljs-keyword">in</span> geoFilter FILTER DISTANCE(doc.latitude, doc.longitude, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>) &lt; <span class="hljs-number">2000</span> RETURN doc
Execution plan:
Id NodeType Est. Comment
<span class="hljs-number">1</span> SingletonNode <span class="hljs-number">1</span> * ROOT
<span class="hljs-number">6</span> IndexNode <span class="hljs-number">703</span> - FOR doc IN geoFilter <span class="hljs-comment">/* geo index scan */</span>
<span class="hljs-number">5</span> ReturnNode <span class="hljs-number">703</span> - RETURN doc
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
<span class="hljs-number">6</span> idx_1646382083452436480 geo geoFilter <span class="hljs-literal">false</span> <span class="hljs-literal">true</span> n/a [ <span class="hljs-string">`latitude`</span>, <span class="hljs-string">`longitude`</span> ] (GEO_DISTANCE([ <span class="hljs-number">0</span>, <span class="hljs-number">0</span> ], [ doc.<span class="hljs-string">`longitude`</span>, doc.<span class="hljs-string">`latitude`</span> ]) &lt; <span class="hljs-number">2000</span>)
Optimization rules applied:
Id RuleName
<span class="hljs-number">1</span> geo-index-optimizer
<span class="hljs-number">2</span> remove-unnecessary-calculations<span class="hljs-number">-2</span>
arangosh&gt; db._query(query);
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"83999"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geoFilter/83999"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ez---C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>
}
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="geoIndexFilterOptimization_container_collapse" onclick="$('#geoIndexFilterOptimization_long').hide(); $('#geoIndexFilterOptimization_short').show(); window.location.hash='geoIndexFilterOptimization_container';" class="example_show_button">Hide execution results</div></div>
<div id="geoIndexFilterOptimization_short" onclick="$('#geoIndexFilterOptimization_short').hide(); $('#geoIndexFilterOptimization_long').show();">
<pre>
arangosh&gt; db.geoFilter.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"latitude"</span>, <span class="hljs-string">"longitude"</span> ] });
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geoFilter.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">latitude</span> : i, <span class="hljs-attr">longitude</span> : j });
........&gt; }
........&gt; }
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc in geoFilter FILTER DISTANCE(doc.latitude, doc.longitude, 0, 0) &lt; 2000 RETURN doc"</span>
arangosh&gt; db._explain(query, {}, {<span class="hljs-attr">colors</span>: <span class="hljs-literal">false</span>});
arangosh&gt; db._query(query);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock geoIndexFilterOptimization
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeDefinitionsSimple
<div class="example-container" id="generalGraphEdgeDefinitionsSimple_container">
<a class="anchorjs-link " href="#generalGraphEdgeDefinitionsSimple_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeDefinitionsSimple_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; directed_relation = graph_module._relation(<span class="hljs-string">"lives_in"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"city"</span>);
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"lives_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
}
arangosh&gt; undirected_relation = graph_module._relation(<span class="hljs-string">"knows"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"user"</span>);
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"knows"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"user"</span>
]
}
arangosh&gt; edgedefinitions = graph_module._edgeDefinitions(directed_relation, undirected_relation);
[
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"lives_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
},
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"knows"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"user"</span>
]
}
]
</pre>
<div id="generalGraphEdgeDefinitionsSimple_container_collapse" onclick="$('#generalGraphEdgeDefinitionsSimple_long').hide(); $('#generalGraphEdgeDefinitionsSimple_short').show(); window.location.hash='generalGraphEdgeDefinitionsSimple_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphEdgeDefinitionsSimple_short" onclick="$('#generalGraphEdgeDefinitionsSimple_short').hide(); $('#generalGraphEdgeDefinitionsSimple_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; directed_relation = graph_module._relation(<span class="hljs-string">"lives_in"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"city"</span>);
arangosh&gt; undirected_relation = graph_module._relation(<span class="hljs-string">"knows"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"user"</span>);
arangosh&gt; edgedefinitions = graph_module._edgeDefinitions(directed_relation, undirected_relation);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphEdgeDefinitionsSimple
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeDefinitionsExtend
<div class="example-container" id="generalGraphEdgeDefinitionsExtend_container">
<a class="anchorjs-link " href="#generalGraphEdgeDefinitionsExtend_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeDefinitionsExtend_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; directed_relation = graph_module._relation(<span class="hljs-string">"lives_in"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"city"</span>);
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"lives_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
}
arangosh&gt; undirected_relation = graph_module._relation(<span class="hljs-string">"knows"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"user"</span>);
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"knows"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"user"</span>
]
}
arangosh&gt; edgedefinitions = graph_module._edgeDefinitions(directed_relation);
[
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"lives_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
}
]
arangosh&gt; edgedefinitions = graph_module._extendEdgeDefinitions(undirected_relation);
</pre>
<div id="generalGraphEdgeDefinitionsExtend_container_collapse" onclick="$('#generalGraphEdgeDefinitionsExtend_long').hide(); $('#generalGraphEdgeDefinitionsExtend_short').show(); window.location.hash='generalGraphEdgeDefinitionsExtend_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphEdgeDefinitionsExtend_short" onclick="$('#generalGraphEdgeDefinitionsExtend_short').hide(); $('#generalGraphEdgeDefinitionsExtend_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; directed_relation = graph_module._relation(<span class="hljs-string">"lives_in"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"city"</span>);
arangosh&gt; undirected_relation = graph_module._relation(<span class="hljs-string">"knows"</span>, <span class="hljs-string">"user"</span>, <span class="hljs-string">"user"</span>);
arangosh&gt; edgedefinitions = graph_module._edgeDefinitions(directed_relation);
arangosh&gt; edgedefinitions = graph_module._extendEdgeDefinitions(undirected_relation);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphEdgeDefinitionsExtend
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphRelationDefinitionSave
<div class="example-container" id="generalGraphRelationDefinitionSave_container">
<a class="anchorjs-link " href="#generalGraphRelationDefinitionSave_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphRelationDefinitionSave_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._relation(<span class="hljs-string">"has_bought"</span>, [<span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Company"</span>], [<span class="hljs-string">"Groceries"</span>, <span class="hljs-string">"Electronics"</span>]);
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"has_bought"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"Customer"</span>,
<span class="hljs-string">"Company"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"Groceries"</span>,
<span class="hljs-string">"Electronics"</span>
]
}
</pre>
<div id="generalGraphRelationDefinitionSave_container_collapse" onclick="$('#generalGraphRelationDefinitionSave_long').hide(); $('#generalGraphRelationDefinitionSave_short').show(); window.location.hash='generalGraphRelationDefinitionSave_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphRelationDefinitionSave_short" onclick="$('#generalGraphRelationDefinitionSave_short').hide(); $('#generalGraphRelationDefinitionSave_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._relation(<span class="hljs-string">"has_bought"</span>, [<span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Company"</span>], [<span class="hljs-string">"Groceries"</span>, <span class="hljs-string">"Electronics"</span>]);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphRelationDefinitionSave
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphRelationDefinitionSingle
<div class="example-container" id="generalGraphRelationDefinitionSingle_container">
<a class="anchorjs-link " href="#generalGraphRelationDefinitionSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphRelationDefinitionSingle_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._relation(<span class="hljs-string">"has_bought"</span>, <span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Product"</span>);
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"has_bought"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"Customer"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"Product"</span>
]
}
</pre>
<div id="generalGraphRelationDefinitionSingle_container_collapse" onclick="$('#generalGraphRelationDefinitionSingle_long').hide(); $('#generalGraphRelationDefinitionSingle_short').show(); window.location.hash='generalGraphRelationDefinitionSingle_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphRelationDefinitionSingle_short" onclick="$('#generalGraphRelationDefinitionSingle_short').hide(); $('#generalGraphRelationDefinitionSingle_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._relation(<span class="hljs-string">"has_bought"</span>, <span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Product"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphRelationDefinitionSingle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphCreateGraphNoData
<div class="example-container" id="generalGraphCreateGraphNoData_container">
<a class="anchorjs-link " href="#generalGraphCreateGraphNoData_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphCreateGraphNoData_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph = graph_module._create(<span class="hljs-string">"myGraph"</span>);
{[Graph]
}
</pre>
</div>
</div>
@endDocuBlock generalGraphCreateGraphNoData
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphCreateGraphSingle
<div class="example-container" id="generalGraphCreateGraphSingle_container">
<a class="anchorjs-link " href="#generalGraphCreateGraphSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphCreateGraphSingle_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> edgeDefinitions = [ { <span class="hljs-attr">collection</span>: <span class="hljs-string">"edges"</span>, <span class="hljs-string">"from"</span>: [ <span class="hljs-string">"vertices"</span> ], <span class="hljs-string">"to"</span> : [ <span class="hljs-string">"vertices"</span> ] } ];
arangosh&gt; graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, edgeDefinitions);
{[Graph]
<span class="hljs-string">"edges"</span> : [ArangoCollection <span class="hljs-number">75096</span>, <span class="hljs-string">"edges"</span> (type edge, status loaded)],
<span class="hljs-string">"vertices"</span> : [ArangoCollection <span class="hljs-number">75093</span>, <span class="hljs-string">"vertices"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
}
</pre>
</div>
</div>
@endDocuBlock generalGraphCreateGraphSingle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphCreateGraph2
<div class="example-container" id="generalGraphCreateGraph2_container">
<a class="anchorjs-link " href="#generalGraphCreateGraph2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphCreateGraph2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph = graph_module._create(<span class="hljs-string">"myGraph"</span>,
........&gt; [graph_module._relation(<span class="hljs-string">"myRelation"</span>, [<span class="hljs-string">"male"</span>, <span class="hljs-string">"female"</span>], [<span class="hljs-string">"male"</span>, <span class="hljs-string">"female"</span>])], [<span class="hljs-string">"sessions"</span>]);
{[Graph]
<span class="hljs-string">"myRelation"</span> : [ArangoCollection <span class="hljs-number">74980</span>, <span class="hljs-string">"myRelation"</span> (type edge, status loaded)],
<span class="hljs-string">"female"</span> : [ArangoCollection <span class="hljs-number">74974</span>, <span class="hljs-string">"female"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"male"</span> : [ArangoCollection <span class="hljs-number">74977</span>, <span class="hljs-string">"male"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"sessions"</span> : [ArangoCollection <span class="hljs-number">74971</span>, <span class="hljs-string">"sessions"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
}
</pre>
<div id="generalGraphCreateGraph2_container_collapse" onclick="$('#generalGraphCreateGraph2_long').hide(); $('#generalGraphCreateGraph2_short').show(); window.location.hash='generalGraphCreateGraph2_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphCreateGraph2_short" onclick="$('#generalGraphCreateGraph2_short').hide(); $('#generalGraphCreateGraph2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph = graph_module._create(<span class="hljs-string">"myGraph"</span>,
........&gt; [graph_module._relation(<span class="hljs-string">"myRelation"</span>, [<span class="hljs-string">"male"</span>, <span class="hljs-string">"female"</span>], [<span class="hljs-string">"male"</span>, <span class="hljs-string">"female"</span>])], [<span class="hljs-string">"sessions"</span>]);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphCreateGraph2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph_create_graph_example1
<div class="example-container" id="general_graph_create_graph_example1_container">
<a class="anchorjs-link " href="#general_graph_create_graph_example1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph_create_graph_example1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> edgeDefinitions = graph_module._edgeDefinitions();
arangosh&gt; graph_module._extendEdgeDefinitions(edgeDefinitions, graph_module._relation(<span class="hljs-string">"friend_of"</span>, <span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Customer"</span>));
arangosh&gt; graph_module._extendEdgeDefinitions(
........&gt; edgeDefinitions, graph_module._relation(
........&gt; <span class="hljs-string">"has_bought"</span>, [<span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Company"</span>], [<span class="hljs-string">"Groceries"</span>, <span class="hljs-string">"Electronics"</span>]));
arangosh&gt; graph_module._create(<span class="hljs-string">"myStore"</span>, edgeDefinitions);
{[Graph]
<span class="hljs-string">"friend_of"</span> : [ArangoCollection <span class="hljs-number">78962</span>, <span class="hljs-string">"friend_of"</span> (type edge, status loaded)],
<span class="hljs-string">"Customer"</span> : [ArangoCollection <span class="hljs-number">78954</span>, <span class="hljs-string">"Customer"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"has_bought"</span> : [ArangoCollection <span class="hljs-number">78957</span>, <span class="hljs-string">"has_bought"</span> (type edge, status loaded)],
<span class="hljs-string">"Company"</span> : [ArangoCollection <span class="hljs-number">78951</span>, <span class="hljs-string">"Company"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"Electronics"</span> : [ArangoCollection <span class="hljs-number">78948</span>, <span class="hljs-string">"Electronics"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"Groceries"</span> : [ArangoCollection <span class="hljs-number">78945</span>, <span class="hljs-string">"Groceries"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
}
</pre>
<div id="general_graph_create_graph_example1_container_collapse" onclick="$('#general_graph_create_graph_example1_long').hide(); $('#general_graph_create_graph_example1_short').show(); window.location.hash='general_graph_create_graph_example1_container';" class="example_show_button">Hide execution results</div></div>
<div id="general_graph_create_graph_example1_short" onclick="$('#general_graph_create_graph_example1_short').hide(); $('#general_graph_create_graph_example1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> edgeDefinitions = graph_module._edgeDefinitions();
arangosh&gt; graph_module._extendEdgeDefinitions(edgeDefinitions, graph_module._relation(<span class="hljs-string">"friend_of"</span>, <span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Customer"</span>));
arangosh&gt; graph_module._extendEdgeDefinitions(
........&gt; edgeDefinitions, graph_module._relation(
........&gt; <span class="hljs-string">"has_bought"</span>, [<span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Company"</span>], [<span class="hljs-string">"Groceries"</span>, <span class="hljs-string">"Electronics"</span>]));
arangosh&gt; graph_module._create(<span class="hljs-string">"myStore"</span>, edgeDefinitions);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock general_graph_create_graph_example1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph_create_graph_example2
<div class="example-container" id="general_graph_create_graph_example2_container">
<a class="anchorjs-link " href="#general_graph_create_graph_example2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph_create_graph_example2_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> edgeDefinitions = graph_module._edgeDefinitions(
........&gt; graph_module._relation(<span class="hljs-string">"friend_of"</span>, [<span class="hljs-string">"Customer"</span>], [<span class="hljs-string">"Customer"</span>]), graph_module._relation(
........&gt; <span class="hljs-string">"has_bought"</span>, [<span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Company"</span>], [<span class="hljs-string">"Groceries"</span>, <span class="hljs-string">"Electronics"</span>]));
arangosh&gt; graph_module._create(<span class="hljs-string">"myStore"</span>, edgeDefinitions);
{[Graph]
<span class="hljs-string">"friend_of"</span> : [ArangoCollection <span class="hljs-number">78998</span>, <span class="hljs-string">"friend_of"</span> (type edge, status loaded)],
<span class="hljs-string">"Customer"</span> : [ArangoCollection <span class="hljs-number">78990</span>, <span class="hljs-string">"Customer"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"has_bought"</span> : [ArangoCollection <span class="hljs-number">78993</span>, <span class="hljs-string">"has_bought"</span> (type edge, status loaded)],
<span class="hljs-string">"Company"</span> : [ArangoCollection <span class="hljs-number">78987</span>, <span class="hljs-string">"Company"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"Electronics"</span> : [ArangoCollection <span class="hljs-number">78984</span>, <span class="hljs-string">"Electronics"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"Groceries"</span> : [ArangoCollection <span class="hljs-number">78981</span>, <span class="hljs-string">"Groceries"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
}
</pre>
<div id="general_graph_create_graph_example2_container_collapse" onclick="$('#general_graph_create_graph_example2_long').hide(); $('#general_graph_create_graph_example2_short').show(); window.location.hash='general_graph_create_graph_example2_container';" class="example_show_button">Hide execution results</div></div>
<div id="general_graph_create_graph_example2_short" onclick="$('#general_graph_create_graph_example2_short').hide(); $('#general_graph_create_graph_example2_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> edgeDefinitions = graph_module._edgeDefinitions(
........&gt; graph_module._relation(<span class="hljs-string">"friend_of"</span>, [<span class="hljs-string">"Customer"</span>], [<span class="hljs-string">"Customer"</span>]), graph_module._relation(
........&gt; <span class="hljs-string">"has_bought"</span>, [<span class="hljs-string">"Customer"</span>, <span class="hljs-string">"Company"</span>], [<span class="hljs-string">"Groceries"</span>, <span class="hljs-string">"Electronics"</span>]));
arangosh&gt; graph_module._create(<span class="hljs-string">"myStore"</span>, edgeDefinitions);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock general_graph_create_graph_example2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphList
<div class="example-container" id="generalGraphList_container">
<a class="anchorjs-link " href="#generalGraphList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphList_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._list();
[ ]
</pre>
</div>
</div>
@endDocuBlock generalGraphList
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphLoadGraph
<div class="example-container" id="generalGraphLoadGraph_container">
<a class="anchorjs-link " href="#generalGraphLoadGraph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphLoadGraph_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph = graph_module._graph(<span class="hljs-string">"social"</span>);
{[Graph]
<span class="hljs-string">"relation"</span> : [ArangoCollection <span class="hljs-number">75534</span>, <span class="hljs-string">"relation"</span> (type edge, status loaded)],
<span class="hljs-string">"female"</span> : [ArangoCollection <span class="hljs-number">75524</span>, <span class="hljs-string">"female"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
<span class="hljs-string">"male"</span> : [ArangoCollection <span class="hljs-number">75529</span>, <span class="hljs-string">"male"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
}
</pre>
<div id="generalGraphLoadGraph_container_collapse" onclick="$('#generalGraphLoadGraph_long').hide(); $('#generalGraphLoadGraph_short').show(); window.location.hash='generalGraphLoadGraph_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphLoadGraph_short" onclick="$('#generalGraphLoadGraph_short').hide(); $('#generalGraphLoadGraph_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph = graph_module._graph(<span class="hljs-string">"social"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphLoadGraph
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphDropGraphKeep
<div class="example-container" id="generalGraphDropGraphKeep_container">
<a class="anchorjs-link " href="#generalGraphDropGraphKeep_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphDropGraphKeep_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._drop(<span class="hljs-string">"social"</span>);
arangosh&gt; db._collection(<span class="hljs-string">"female"</span>);
[ArangoCollection <span class="hljs-number">75155</span>, <span class="hljs-string">"female"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._collection(<span class="hljs-string">"male"</span>);
[ArangoCollection <span class="hljs-number">75160</span>, <span class="hljs-string">"male"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._collection(<span class="hljs-string">"relation"</span>);
[ArangoCollection <span class="hljs-number">75165</span>, <span class="hljs-string">"relation"</span> (type edge, status loaded)]
</pre>
</div>
</div>
@endDocuBlock generalGraphDropGraphKeep
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphDropGraphDropCollections
<div class="example-container" id="generalGraphDropGraphDropCollections_container">
<a class="anchorjs-link " href="#generalGraphDropGraphDropCollections_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphDropGraphDropCollections_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; graph_module._drop(<span class="hljs-string">"social"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; db._collection(<span class="hljs-string">"female"</span>);
<span class="hljs-literal">null</span>
arangosh&gt; db._collection(<span class="hljs-string">"male"</span>);
<span class="hljs-literal">null</span>
arangosh&gt; db._collection(<span class="hljs-string">"relation"</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock generalGraphDropGraphDropCollections
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__extendEdgeDefinitions
<div class="example-container" id="general_graph__extendEdgeDefinitions_container">
<a class="anchorjs-link " href="#general_graph__extendEdgeDefinitions_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__extendEdgeDefinitions_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> ed2 = graph_module._relation(<span class="hljs-string">"myEC2"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC3"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1]);
arangosh&gt; graph._extendEdgeDefinitions(ed2);
</pre>
</div>
</div>
@endDocuBlock general_graph__extendEdgeDefinitions
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__editEdgeDefinition
<div class="example-container" id="general_graph__editEdgeDefinition_container">
<a class="anchorjs-link " href="#general_graph__editEdgeDefinition_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__editEdgeDefinition_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> original = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> modified = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC2"</span>], [<span class="hljs-string">"myVC3"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [original]);
arangosh&gt; graph._editEdgeDefinitions(modified);
</pre>
</div>
</div>
@endDocuBlock general_graph__editEdgeDefinition
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__deleteEdgeDefinitionNoDrop
<div class="example-container" id="general_graph__deleteEdgeDefinitionNoDrop_container">
<a class="anchorjs-link " href="#general_graph__deleteEdgeDefinitionNoDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__deleteEdgeDefinitionNoDrop_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> ed2 = graph_module._relation(<span class="hljs-string">"myEC2"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC3"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1, ed2]);
arangosh&gt; graph._deleteEdgeDefinition(<span class="hljs-string">"myEC1"</span>);
arangosh&gt; db._collection(<span class="hljs-string">"myEC1"</span>);
[ArangoCollection <span class="hljs-number">78713</span>, <span class="hljs-string">"myEC1"</span> (type edge, status loaded)]
</pre>
</div>
</div>
@endDocuBlock general_graph__deleteEdgeDefinitionNoDrop
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__deleteEdgeDefinitionWithDrop
<div class="example-container" id="general_graph__deleteEdgeDefinitionWithDrop_container">
<a class="anchorjs-link " href="#general_graph__deleteEdgeDefinitionWithDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__deleteEdgeDefinitionWithDrop_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> ed2 = graph_module._relation(<span class="hljs-string">"myEC2"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC3"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1, ed2]);
arangosh&gt; graph._deleteEdgeDefinition(<span class="hljs-string">"myEC1"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; db._collection(<span class="hljs-string">"myEC1"</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock general_graph__deleteEdgeDefinitionWithDrop
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__addVertexCollection
<div class="example-container" id="general_graph__addVertexCollection_container">
<a class="anchorjs-link " href="#general_graph__addVertexCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__addVertexCollection_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1]);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"myVC3"</span>, <span class="hljs-literal">true</span>);
</pre>
</div>
</div>
@endDocuBlock general_graph__addVertexCollection
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__orphanCollections
<div class="example-container" id="general_graph__orphanCollections_container">
<a class="anchorjs-link " href="#general_graph__orphanCollections_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__orphanCollections_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1]);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"myVC3"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; graph._orphanCollections();
[
<span class="hljs-string">"myVC3"</span>
]
</pre>
</div>
</div>
@endDocuBlock general_graph__orphanCollections
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline general_graph__removeVertexCollections
<div class="example-container" id="general_graph__removeVertexCollections_container">
<a class="anchorjs-link " href="#general_graph__removeVertexCollections_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="general_graph__removeVertexCollections_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1]);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"myVC3"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"myVC4"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; graph._orphanCollections();
[
<span class="hljs-string">"myVC3"</span>,
<span class="hljs-string">"myVC4"</span>
]
arangosh&gt; graph._removeVertexCollection(<span class="hljs-string">"myVC3"</span>);
arangosh&gt; graph._orphanCollections();
[
<span class="hljs-string">"myVC4"</span>
]
</pre>
<div id="general_graph__removeVertexCollections_container_collapse" onclick="$('#general_graph__removeVertexCollections_long').hide(); $('#general_graph__removeVertexCollections_short').show(); window.location.hash='general_graph__removeVertexCollections_container';" class="example_show_button">Hide execution results</div></div>
<div id="general_graph__removeVertexCollections_short" onclick="$('#general_graph__removeVertexCollections_short').hide(); $('#general_graph__removeVertexCollections_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> graph_module = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/general-graph"</span>)
arangosh&gt; <span class="hljs-keyword">var</span> ed1 = graph_module._relation(<span class="hljs-string">"myEC1"</span>, [<span class="hljs-string">"myVC1"</span>], [<span class="hljs-string">"myVC2"</span>]);
arangosh&gt; <span class="hljs-keyword">var</span> graph = graph_module._create(<span class="hljs-string">"myGraph"</span>, [ed1]);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"myVC3"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; graph._addVertexCollection(<span class="hljs-string">"myVC4"</span>, <span class="hljs-literal">true</span>);
arangosh&gt; graph._orphanCollections();
arangosh&gt; graph._removeVertexCollection(<span class="hljs-string">"myVC3"</span>);
arangosh&gt; graph._orphanCollections();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock general_graph__removeVertexCollections
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphVertexCollectionSave
<div class="example-container" id="generalGraphVertexCollectionSave_container">
<a class="anchorjs-link " href="#generalGraphVertexCollectionSave_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphVertexCollectionSave_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.male.save({<span class="hljs-attr">name</span>: <span class="hljs-string">"Floyd"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"floyd"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/floyd"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"floyd"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eMW--E"</span>
}
</pre>
<div id="generalGraphVertexCollectionSave_container_collapse" onclick="$('#generalGraphVertexCollectionSave_long').hide(); $('#generalGraphVertexCollectionSave_short').show(); window.location.hash='generalGraphVertexCollectionSave_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphVertexCollectionSave_short" onclick="$('#generalGraphVertexCollectionSave_short').hide(); $('#generalGraphVertexCollectionSave_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.male.save({<span class="hljs-attr">name</span>: <span class="hljs-string">"Floyd"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"floyd"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphVertexCollectionSave
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphVertexCollectionReplace
<div class="example-container" id="generalGraphVertexCollectionReplace_container">
<a class="anchorjs-link " href="#generalGraphVertexCollectionReplace_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphVertexCollectionReplace_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.male.save({<span class="hljs-attr">neym</span>: <span class="hljs-string">"Jon"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"john"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/john"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"john"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eLu--C"</span>
}
arangosh&gt; graph.male.replace(<span class="hljs-string">"male/john"</span>, {<span class="hljs-attr">name</span>: <span class="hljs-string">"John"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/john"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"john"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eLu--F"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6eLu--C"</span>
}
</pre>
<div id="generalGraphVertexCollectionReplace_container_collapse" onclick="$('#generalGraphVertexCollectionReplace_long').hide(); $('#generalGraphVertexCollectionReplace_short').show(); window.location.hash='generalGraphVertexCollectionReplace_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphVertexCollectionReplace_short" onclick="$('#generalGraphVertexCollectionReplace_short').hide(); $('#generalGraphVertexCollectionReplace_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.male.save({<span class="hljs-attr">neym</span>: <span class="hljs-string">"Jon"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"john"</span>});
arangosh&gt; graph.male.replace(<span class="hljs-string">"male/john"</span>, {<span class="hljs-attr">name</span>: <span class="hljs-string">"John"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphVertexCollectionReplace
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphVertexCollectionUpdate
<div class="example-container" id="generalGraphVertexCollectionUpdate_container">
<a class="anchorjs-link " href="#generalGraphVertexCollectionUpdate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphVertexCollectionUpdate_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.female.save({<span class="hljs-attr">name</span>: <span class="hljs-string">"Lynda"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"linda"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/linda"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"linda"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eM6--E"</span>
}
arangosh&gt; graph.female.update(<span class="hljs-string">"female/linda"</span>, {<span class="hljs-attr">name</span>: <span class="hljs-string">"Linda"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"linda"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/linda"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"linda"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eN---_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6eM6--E"</span>
}
</pre>
<div id="generalGraphVertexCollectionUpdate_container_collapse" onclick="$('#generalGraphVertexCollectionUpdate_long').hide(); $('#generalGraphVertexCollectionUpdate_short').show(); window.location.hash='generalGraphVertexCollectionUpdate_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphVertexCollectionUpdate_short" onclick="$('#generalGraphVertexCollectionUpdate_short').hide(); $('#generalGraphVertexCollectionUpdate_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.female.save({<span class="hljs-attr">name</span>: <span class="hljs-string">"Lynda"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"linda"</span>});
arangosh&gt; graph.female.update(<span class="hljs-string">"female/linda"</span>, {<span class="hljs-attr">name</span>: <span class="hljs-string">"Linda"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"linda"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphVertexCollectionUpdate
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphVertexCollectionRemove
<div class="example-container" id="generalGraphVertexCollectionRemove_container">
<a class="anchorjs-link " href="#generalGraphVertexCollectionRemove_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphVertexCollectionRemove_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.male.save({<span class="hljs-attr">name</span>: <span class="hljs-string">"Kermit"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"kermit"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/kermit"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"kermit"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6eLC---"</span>
}
arangosh&gt; db._exists(<span class="hljs-string">"male/kermit"</span>)
<span class="hljs-literal">true</span>
arangosh&gt; graph.male.remove(<span class="hljs-string">"male/kermit"</span>)
<span class="hljs-literal">true</span>
arangosh&gt; db._exists(<span class="hljs-string">"male/kermit"</span>)
<span class="hljs-literal">false</span>
</pre>
<div id="generalGraphVertexCollectionRemove_container_collapse" onclick="$('#generalGraphVertexCollectionRemove_long').hide(); $('#generalGraphVertexCollectionRemove_short').show(); window.location.hash='generalGraphVertexCollectionRemove_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphVertexCollectionRemove_short" onclick="$('#generalGraphVertexCollectionRemove_short').hide(); $('#generalGraphVertexCollectionRemove_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.male.save({<span class="hljs-attr">name</span>: <span class="hljs-string">"Kermit"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"kermit"</span>});
arangosh&gt; db._exists(<span class="hljs-string">"male/kermit"</span>)
arangosh&gt; graph.male.remove(<span class="hljs-string">"male/kermit"</span>)
arangosh&gt; db._exists(<span class="hljs-string">"male/kermit"</span>)
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphVertexCollectionRemove
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeCollectionSave1
<div class="example-container" id="generalGraphEdgeCollectionSave1_container">
<a class="anchorjs-link " href="#generalGraphEdgeCollectionSave1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeCollectionSave1_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"male/bob"</span>, <span class="hljs-string">"female/alice"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"married"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"bobAndAlice"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/bobAndAlice"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bobAndAlice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dfa---"</span>
}
</pre>
<div id="generalGraphEdgeCollectionSave1_container_collapse" onclick="$('#generalGraphEdgeCollectionSave1_long').hide(); $('#generalGraphEdgeCollectionSave1_short').show(); window.location.hash='generalGraphEdgeCollectionSave1_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphEdgeCollectionSave1_short" onclick="$('#generalGraphEdgeCollectionSave1_short').hide(); $('#generalGraphEdgeCollectionSave1_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"male/bob"</span>, <span class="hljs-string">"female/alice"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"married"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"bobAndAlice"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphEdgeCollectionSave1
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeCollectionSave2
<div class="example-container" id="generalGraphEdgeCollectionSave2_container">
<a class="anchorjs-link " href="#generalGraphEdgeCollectionSave2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeCollectionSave2_long">
<pre>
arangosh&gt; var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh&gt; var graph = examples.loadGraph("social");
arangosh&gt; graph.relation.save(
........&gt; "relation/aliceAndBob",
........&gt; "female/alice",
........&gt; {type: "married", _key: "bobAndAlice"});
[ArangoError 1906: invalid edge between relation/aliceAndBob and female/alice. Doesn't conform to any edge definition]
</pre>
</div>
</div>
@endDocuBlock generalGraphEdgeCollectionSave2
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeCollectionReplace
<div class="example-container" id="generalGraphEdgeCollectionReplace_container">
<a class="anchorjs-link " href="#generalGraphEdgeCollectionReplace_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeCollectionReplace_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"female/alice"</span>, <span class="hljs-string">"female/diana"</span>, {<span class="hljs-attr">typo</span>: <span class="hljs-string">"nose"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/aliceAndDiana"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"aliceAndDiana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6deu--E"</span>
}
arangosh&gt; graph.relation.replace(<span class="hljs-string">"relation/aliceAndDiana"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"knows"</span>, <span class="hljs-attr">_from</span>: <span class="hljs-string">"female/alice"</span>, <span class="hljs-attr">_to</span>: <span class="hljs-string">"female/diana"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/aliceAndDiana"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"aliceAndDiana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dey--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6deu--E"</span>
}
</pre>
<div id="generalGraphEdgeCollectionReplace_container_collapse" onclick="$('#generalGraphEdgeCollectionReplace_long').hide(); $('#generalGraphEdgeCollectionReplace_short').show(); window.location.hash='generalGraphEdgeCollectionReplace_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphEdgeCollectionReplace_short" onclick="$('#generalGraphEdgeCollectionReplace_short').hide(); $('#generalGraphEdgeCollectionReplace_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"female/alice"</span>, <span class="hljs-string">"female/diana"</span>, {<span class="hljs-attr">typo</span>: <span class="hljs-string">"nose"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
arangosh&gt; graph.relation.replace(<span class="hljs-string">"relation/aliceAndDiana"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"knows"</span>, <span class="hljs-attr">_from</span>: <span class="hljs-string">"female/alice"</span>, <span class="hljs-attr">_to</span>: <span class="hljs-string">"female/diana"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphEdgeCollectionReplace
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeCollectionUpdate
<div class="example-container" id="generalGraphEdgeCollectionUpdate_container">
<a class="anchorjs-link " href="#generalGraphEdgeCollectionUpdate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeCollectionUpdate_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"female/alice"</span>, <span class="hljs-string">"female/diana"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"knows"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/aliceAndDiana"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"aliceAndDiana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dgm---"</span>
}
arangosh&gt; graph.relation.update(<span class="hljs-string">"relation/aliceAndDiana"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"quarreled"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/aliceAndDiana"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"aliceAndDiana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dgm--B"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dgm---"</span>
}
</pre>
<div id="generalGraphEdgeCollectionUpdate_container_collapse" onclick="$('#generalGraphEdgeCollectionUpdate_long').hide(); $('#generalGraphEdgeCollectionUpdate_short').show(); window.location.hash='generalGraphEdgeCollectionUpdate_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphEdgeCollectionUpdate_short" onclick="$('#generalGraphEdgeCollectionUpdate_short').hide(); $('#generalGraphEdgeCollectionUpdate_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"female/alice"</span>, <span class="hljs-string">"female/diana"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"knows"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
arangosh&gt; graph.relation.update(<span class="hljs-string">"relation/aliceAndDiana"</span>, {<span class="hljs-attr">type</span>: <span class="hljs-string">"quarreled"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphEdgeCollectionUpdate
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/graphs-general-graphs-management.md -->
@startDocuBlockInline generalGraphEdgeCollectionRemove
<div class="example-container" id="generalGraphEdgeCollectionRemove_container">
<a class="anchorjs-link " href="#generalGraphEdgeCollectionRemove_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="generalGraphEdgeCollectionRemove_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"female/alice"</span>, <span class="hljs-string">"female/diana"</span>, {<span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/aliceAndDiana"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"aliceAndDiana"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6de---A"</span>
}
arangosh&gt; db._exists(<span class="hljs-string">"relation/aliceAndDiana"</span>)
<span class="hljs-literal">true</span>
arangosh&gt; graph.relation.remove(<span class="hljs-string">"relation/aliceAndDiana"</span>)
<span class="hljs-literal">true</span>
arangosh&gt; db._exists(<span class="hljs-string">"relation/aliceAndDiana"</span>)
<span class="hljs-literal">false</span>
</pre>
<div id="generalGraphEdgeCollectionRemove_container_collapse" onclick="$('#generalGraphEdgeCollectionRemove_long').hide(); $('#generalGraphEdgeCollectionRemove_short').show(); window.location.hash='generalGraphEdgeCollectionRemove_container';" class="example_show_button">Hide execution results</div></div>
<div id="generalGraphEdgeCollectionRemove_short" onclick="$('#generalGraphEdgeCollectionRemove_short').hide(); $('#generalGraphEdgeCollectionRemove_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"social"</span>);
arangosh&gt; graph.relation.save(<span class="hljs-string">"female/alice"</span>, <span class="hljs-string">"female/diana"</span>, {<span class="hljs-attr">_key</span>: <span class="hljs-string">"aliceAndDiana"</span>});
arangosh&gt; db._exists(<span class="hljs-string">"relation/aliceAndDiana"</span>)
arangosh&gt; graph.relation.remove(<span class="hljs-string">"relation/aliceAndDiana"</span>)
arangosh&gt; db._exists(<span class="hljs-string">"relation/aliceAndDiana"</span>)
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock generalGraphEdgeCollectionRemove
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-skiplist.md -->
@startDocuBlockInline ensureUniqueSkiplistSingle
<div class="example-container" id="ensureUniqueSkiplistSingle_container">
<a class="anchorjs-link " href="#ensureUniqueSkiplistSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureUniqueSkiplistSingle_long" style="Display: none;">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"myId"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"myId"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"ids/74892"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382082012741632"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74896"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74896"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dY6--_"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">456</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74898"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74898"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZ----"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">789</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74900"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74900"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZ---A"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
[ArangoError <span class="hljs-number">1210</span>: unique constraint violated - <span class="hljs-keyword">in</span> index idx_1646382082012741632 <span class="hljs-keyword">of</span> type skiplist over <span class="hljs-string">'myId'</span>; conflicting key: <span class="hljs-number">74896</span>]
</pre>
<div id="ensureUniqueSkiplistSingle_container_collapse" onclick="$('#ensureUniqueSkiplistSingle_long').hide(); $('#ensureUniqueSkiplistSingle_short').show(); window.location.hash='ensureUniqueSkiplistSingle_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureUniqueSkiplistSingle_short" onclick="$('#ensureUniqueSkiplistSingle_short').hide(); $('#ensureUniqueSkiplistSingle_long').show();">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"myId"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">456</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">789</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"myId"</span>: <span class="hljs-number">123</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureUniqueSkiplistSingle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-skiplist.md -->
@startDocuBlockInline ensureUniqueSkiplistMultiColumn
<div class="example-container" id="ensureUniqueSkiplistMultiColumn_container">
<a class="anchorjs-link " href="#ensureUniqueSkiplistMultiColumn_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureUniqueSkiplistMultiColumn_long" style="Display: none;">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"name.first"</span>, <span class="hljs-string">"name.last"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"name.first"</span>,
<span class="hljs-string">"name.last"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"ids/74873"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382082007498754"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74877"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74877"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dYq---"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"jens"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74879"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74879"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dYq--A"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"ids/74881"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74881"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dYq--C"</span>
}
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
[ArangoError <span class="hljs-number">1210</span>: unique constraint violated - <span class="hljs-keyword">in</span> index idx_1646382082007498754 <span class="hljs-keyword">of</span> type skiplist over <span class="hljs-string">'name.first, name.last'</span>; conflicting key: <span class="hljs-number">74877</span>]
</pre>
<div id="ensureUniqueSkiplistMultiColumn_container_collapse" onclick="$('#ensureUniqueSkiplistMultiColumn_long').hide(); $('#ensureUniqueSkiplistMultiColumn_short').show(); window.location.hash='ensureUniqueSkiplistMultiColumn_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureUniqueSkiplistMultiColumn_short" onclick="$('#ensureUniqueSkiplistMultiColumn_short').hide(); $('#ensureUniqueSkiplistMultiColumn_long').show();">
<pre>
arangosh&gt; db.ids.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"name.first"</span>, <span class="hljs-string">"name.last"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"jens"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"jensen"</span> }});
arangosh&gt; db.ids.save({ <span class="hljs-string">"name"</span> : { <span class="hljs-string">"first"</span> : <span class="hljs-string">"hans"</span>, <span class="hljs-string">"last"</span>: <span class="hljs-string">"hansen"</span> }});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureUniqueSkiplistMultiColumn
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-skiplist.md -->
@startDocuBlockInline ensureSkiplist
<div class="example-container" id="ensureSkiplist_container">
<a class="anchorjs-link " href="#ensureSkiplist_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureSkiplist_long" style="Display: none;">
<pre>
arangosh&gt; db.names.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"first"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"first"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"names/74529"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081949827074"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74533"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74533"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVK--B"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74535"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74535"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVO---"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"John"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74537"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74537"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVO--A"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74539"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74539"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVO--C"</span>
}
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"names/74541"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74541"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVO--E"</span>
}
</pre>
<div id="ensureSkiplist_container_collapse" onclick="$('#ensureSkiplist_long').hide(); $('#ensureSkiplist_short').show(); window.location.hash='ensureSkiplist_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureSkiplist_short" onclick="$('#ensureSkiplist_short').hide(); $('#ensureSkiplist_long').show();">
<pre>
arangosh&gt; db.names.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"first"</span> ] });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"John"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tim"</span> });
arangosh&gt; db.names.save({ <span class="hljs-string">"first"</span> : <span class="hljs-string">"Tom"</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureSkiplist
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-skiplist.md -->
@startDocuBlockInline ensureSkiplistArray
<div class="example-container" id="ensureSkiplistArray_container">
<a class="anchorjs-link " href="#ensureSkiplistArray_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="ensureSkiplistArray_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a[*]"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a[*]"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/74550"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081955069952"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ] });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74554"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74554"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVe--_"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">3</span> ] });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74556"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74556"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVe--B"</span>
}
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-literal">null</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/74558"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74558"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dVi---"</span>
}
</pre>
<div id="ensureSkiplistArray_container_collapse" onclick="$('#ensureSkiplistArray_long').hide(); $('#ensureSkiplistArray_short').show(); window.location.hash='ensureSkiplistArray_container';" class="example_show_button">Hide execution results</div></div>
<div id="ensureSkiplistArray_short" onclick="$('#ensureSkiplistArray_short').hide(); $('#ensureSkiplistArray_long').show();">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a[*]"</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : [ <span class="hljs-number">1</span>, <span class="hljs-number">3</span> ] });
arangosh&gt; db.test.save({ <span class="hljs-attr">a</span> : <span class="hljs-literal">null</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock ensureSkiplistArray
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline collectionGetIndexes
<div class="example-container" id="collectionGetIndexes_container">
<a class="anchorjs-link " href="#collectionGetIndexes_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionGetIndexes_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureHashIndex(<span class="hljs-string">"hashListAttribute"</span>,
........&gt; <span class="hljs-string">"hashListSecondAttribute.subAttribute"</span>);
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"hashListAttribute"</span>,
<span class="hljs-string">"hashListSecondAttribute.subAttribute"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/73883"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081673003009"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.test.getIndexes();
[
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"skiplistAttribute"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/73875"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081671954434"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"skiplistUniqueAttribute"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/73879"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081673003008"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"hashListAttribute"</span>,
<span class="hljs-string">"hashListSecondAttribute.subAttribute"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/73883"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081673003009"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
}
]
</pre>
<div id="collectionGetIndexes_container_collapse" onclick="$('#collectionGetIndexes_long').hide(); $('#collectionGetIndexes_short').show(); window.location.hash='collectionGetIndexes_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionGetIndexes_short" onclick="$('#collectionGetIndexes_short').hide(); $('#collectionGetIndexes_long').show();">
<pre>
arangosh&gt; db.test.ensureHashIndex(<span class="hljs-string">"hashListAttribute"</span>,
........&gt; <span class="hljs-string">"hashListSecondAttribute.subAttribute"</span>);
arangosh&gt; db.test.getIndexes();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionGetIndexes
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline collectionEnsureIndex
<div class="example-container" id="collectionEnsureIndex_container">
<a class="anchorjs-link " href="#collectionEnsureIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionEnsureIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span> ], <span class="hljs-attr">sparse</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/73824"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081650982912"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"test/73828"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081650982913"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="collectionEnsureIndex_container_collapse" onclick="$('#collectionEnsureIndex_long').hide(); $('#collectionEnsureIndex_short').show(); window.location.hash='collectionEnsureIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionEnsureIndex_short" onclick="$('#collectionEnsureIndex_short').hide(); $('#collectionEnsureIndex_long').show();">
<pre>
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span> ], <span class="hljs-attr">sparse</span>: <span class="hljs-literal">true</span> });
arangosh&gt; db.test.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"hash"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ], <span class="hljs-attr">unique</span>: <span class="hljs-literal">true</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionEnsureIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline col_dropIndex
<div class="example-container" id="col_dropIndex_container">
<a class="anchorjs-link " href="#col_dropIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="col_dropIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.example.ensureSkiplist(<span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>);
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/73669"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081331167234"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">var</span> indexInfo = db.example.getIndexes();
arangosh&gt; indexInfo;
[
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/73669"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081331167234"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
}
]
arangosh&gt; db.example.dropIndex(indexInfo[<span class="hljs-number">0</span>])
<span class="hljs-literal">false</span>
arangosh&gt; db.example.dropIndex(indexInfo[<span class="hljs-number">1</span>].id)
<span class="hljs-literal">true</span>
arangosh&gt; indexInfo = db.example.getIndexes();
[
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
}
]
</pre>
<div id="col_dropIndex_container_collapse" onclick="$('#col_dropIndex_long').hide(); $('#col_dropIndex_short').show(); window.location.hash='col_dropIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="col_dropIndex_short" onclick="$('#col_dropIndex_short').hide(); $('#col_dropIndex_long').show();">
<pre>
arangosh&gt; db.example.ensureSkiplist(<span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> indexInfo = db.example.getIndexes();
arangosh&gt; indexInfo;
arangosh&gt; db.example.dropIndex(indexInfo[<span class="hljs-number">0</span>])
arangosh&gt; db.example.dropIndex(indexInfo[<span class="hljs-number">1</span>].id)
arangosh&gt; indexInfo = db.example.getIndexes();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock col_dropIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline LoadIndexesIntoMemory
<div class="example-container" id="loadIndexesIntoMemory_container">
<a class="anchorjs-link " href="#loadIndexesIntoMemory_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="loadIndexesIntoMemory_long">
<pre>
arangosh&gt; db.example.loadIndexesIntoMemory();
{
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
</div>
</div>
@endDocuBlock LoadIndexesIntoMemory
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline IndexHandle
<div class="example-container" id="IndexHandle_container">
<a class="anchorjs-link " href="#IndexHandle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="IndexHandle_long" style="Display: none;">
<pre>
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/68951"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382033803411456"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">var</span> indexInfo = db.example.getIndexes().map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x</span>) </span>{ <span class="hljs-keyword">return</span> x.id; });
arangosh&gt; indexInfo;
[
<span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"example/68951"</span>
]
arangosh&gt; db._index(indexInfo[<span class="hljs-number">0</span>])
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
arangosh&gt; db._index(indexInfo[<span class="hljs-number">1</span>])
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/68951"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382033803411456"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="IndexHandle_container_collapse" onclick="$('#IndexHandle_long').hide(); $('#IndexHandle_short').show(); window.location.hash='IndexHandle_container';" class="example_show_button">Hide execution results</div></div>
<div id="IndexHandle_short" onclick="$('#IndexHandle_short').hide(); $('#IndexHandle_long').show();">
<pre>
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ] });
arangosh&gt; <span class="hljs-keyword">var</span> indexInfo = db.example.getIndexes().map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x</span>) </span>{ <span class="hljs-keyword">return</span> x.id; });
arangosh&gt; indexInfo;
arangosh&gt; db._index(indexInfo[<span class="hljs-number">0</span>])
arangosh&gt; db._index(indexInfo[<span class="hljs-number">1</span>])
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock IndexHandle
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline dropIndex
<div class="example-container" id="dropIndex_container">
<a class="anchorjs-link " href="#dropIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="dropIndex_long" style="Display: none;">
<pre>
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/74433"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081922564096"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">var</span> indexInfo = db.example.getIndexes();
arangosh&gt; indexInfo;
[
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/74433"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081922564096"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
}
]
arangosh&gt; db._dropIndex(indexInfo[<span class="hljs-number">0</span>])
<span class="hljs-literal">false</span>
arangosh&gt; db._dropIndex(indexInfo[<span class="hljs-number">1</span>].id)
<span class="hljs-literal">true</span>
arangosh&gt; indexInfo = db.example.getIndexes();
[
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
}
]
</pre>
<div id="dropIndex_container_collapse" onclick="$('#dropIndex_long').hide(); $('#dropIndex_short').show(); window.location.hash='dropIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="dropIndex_short" onclick="$('#dropIndex_short').hide(); $('#dropIndex_long').show();">
<pre>
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ] });
arangosh&gt; <span class="hljs-keyword">var</span> indexInfo = db.example.getIndexes();
arangosh&gt; indexInfo;
arangosh&gt; db._dropIndex(indexInfo[<span class="hljs-number">0</span>])
arangosh&gt; db._dropIndex(indexInfo[<span class="hljs-number">1</span>].id)
arangosh&gt; indexInfo = db.example.getIndexes();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock dropIndex
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/indexing-working-with-indexes.md -->
@startDocuBlockInline IndexVerify
<div class="example-container" id="IndexVerify_container">
<a class="anchorjs-link " href="#IndexVerify_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="IndexVerify_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> explain = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/explainer"</span>).explain;
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ] });
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"example/68965"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382033809702914"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; explain(<span class="hljs-string">"FOR doc IN example FILTER doc.a &lt; 23 RETURN doc"</span>, {<span class="hljs-attr">colors</span>:<span class="hljs-literal">false</span>});
Query <span class="hljs-built_in">String</span> (<span class="hljs-number">47</span> chars, <span class="hljs-attr">cacheable</span>: <span class="hljs-literal">true</span>):
FOR doc IN example FILTER doc.a &lt; <span class="hljs-number">23</span> RETURN doc
Execution plan:
Id NodeType Est. Comment
<span class="hljs-number">1</span> SingletonNode <span class="hljs-number">1</span> * ROOT
<span class="hljs-number">6</span> IndexNode <span class="hljs-number">0</span> - FOR doc IN example <span class="hljs-comment">/* skiplist index scan */</span>
<span class="hljs-number">5</span> ReturnNode <span class="hljs-number">0</span> - RETURN doc
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
<span class="hljs-number">6</span> idx_1646382033809702914 skiplist example <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-number">100.00</span> % [ <span class="hljs-string">`a`</span>, <span class="hljs-string">`b`</span> ] (doc.<span class="hljs-string">`a`</span> &lt; <span class="hljs-number">23</span>)
Optimization rules applied:
Id RuleName
<span class="hljs-number">1</span> use-indexes
<span class="hljs-number">2</span> remove-filter-covered-by-index
<span class="hljs-number">3</span> remove-unnecessary-calculations<span class="hljs-number">-2</span>
</pre>
<div id="IndexVerify_container_collapse" onclick="$('#IndexVerify_long').hide(); $('#IndexVerify_short').show(); window.location.hash='IndexVerify_container';" class="example_show_button">Hide execution results</div></div>
<div id="IndexVerify_short" onclick="$('#IndexVerify_short').hide(); $('#IndexVerify_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> explain = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/explainer"</span>).explain;
arangosh&gt; db.example.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"skiplist"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span> ] });
arangosh&gt; explain(<span class="hljs-string">"FOR doc IN example FILTER doc.a &lt; 23 RETURN doc"</span>, {<span class="hljs-attr">colors</span>:<span class="hljs-literal">false</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock IndexVerify
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-deprecated-simple-queries-pagination.md -->
@startDocuBlockInline queryLimit
<div class="example-container" id="queryLimit_container">
<a class="anchorjs-link " href="#queryLimit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="queryLimit_long" style="Display: none;">
<pre>
arangosh&gt; db.five.all().toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88594"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88594"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gea---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88596"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88596"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gee---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"two"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88598"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88598"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gee--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"three"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88600"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88600"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gee--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"four"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88602"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88602"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gei---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"five"</span>
}
]
arangosh&gt; db.five.all().limit(<span class="hljs-number">2</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88594"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88594"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gea---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88596"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88596"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gee---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"two"</span>
}
]
</pre>
<div id="queryLimit_container_collapse" onclick="$('#queryLimit_long').hide(); $('#queryLimit_short').show(); window.location.hash='queryLimit_container';" class="example_show_button">Hide execution results</div></div>
<div id="queryLimit_short" onclick="$('#queryLimit_short').hide(); $('#queryLimit_long').show();">
<pre>
arangosh&gt; db.five.all().toArray();
arangosh&gt; db.five.all().limit(<span class="hljs-number">2</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock queryLimit
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-deprecated-simple-queries-pagination.md -->
@startDocuBlockInline querySkip
<div class="example-container" id="querySkip_container">
<a class="anchorjs-link " href="#querySkip_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="querySkip_long" style="Display: none;">
<pre>
arangosh&gt; db.five.all().toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88615"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88615"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ge2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88617"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88617"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ge6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"two"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88619"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88619"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ge6--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"three"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88621"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88621"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ge6--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"four"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88623"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88623"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gf----"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"five"</span>
}
]
arangosh&gt; db.five.all().skip(<span class="hljs-number">3</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88621"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88621"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6ge6--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"four"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88623"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/88623"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6gf----"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"five"</span>
}
]
</pre>
<div id="querySkip_container_collapse" onclick="$('#querySkip_long').hide(); $('#querySkip_short').show(); window.location.hash='querySkip_container';" class="example_show_button">Hide execution results</div></div>
<div id="querySkip_short" onclick="$('#querySkip_short').hide(); $('#querySkip_long').show();">
<pre>
arangosh&gt; db.five.all().toArray();
arangosh&gt; db.five.all().skip(<span class="hljs-number">3</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock querySkip
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-deprecated-simple-queries-pagination.md -->
@startDocuBlockInline cursorCountUnLimited
<div class="example-container" id="cursorCountUnLimited_container">
<a class="anchorjs-link " href="#cursorCountUnLimited_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="cursorCountUnLimited_long">
<pre>
arangosh&gt; db.five.all().limit(<span class="hljs-number">2</span>).count();
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock cursorCountUnLimited
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-deprecated-simple-queries-pagination.md -->
@startDocuBlockInline cursorCountLimit
<div class="example-container" id="cursorCountLimit_container">
<a class="anchorjs-link " href="#cursorCountLimit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="cursorCountLimit_long">
<pre>
arangosh&gt; db.five.all().limit(<span class="hljs-number">2</span>).count(<span class="hljs-literal">true</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock cursorCountLimit
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-deprecated-simple-queries-fulltext-queries.md -->
@startDocuBlockInline collectionFulltext
<div class="example-container" id="collectionFulltext_container">
<a class="anchorjs-link " href="#collectionFulltext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionFulltext_long" style="Display: none;">
<pre>
arangosh&gt; db.emails.ensureFulltextIndex(<span class="hljs-string">"content"</span>);
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"content"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"emails/73855"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"minLength"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382081665662978"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"fulltext"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.emails.save({ <span class="hljs-attr">content</span>:
........&gt; <span class="hljs-string">"Hello Alice, how are you doing? Regards, Bob"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"emails/73859"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73859"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dES---"</span>
}
arangosh&gt; db.emails.save({ <span class="hljs-attr">content</span>:
........&gt; <span class="hljs-string">"Hello Charlie, do Alice and Bob know about it?"</span>});
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"emails/73861"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73861"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dES--A"</span>
}
arangosh&gt; db.emails.save({ <span class="hljs-attr">content</span>: <span class="hljs-string">"I think they don't know. Regards, Eve"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"emails/73863"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73863"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dES--C"</span>
}
arangosh&gt; db.emails.fulltext(<span class="hljs-string">"content"</span>, <span class="hljs-string">"charlie,|eve"</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73861"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"emails/73861"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dES--A"</span>,
<span class="hljs-string">"content"</span> : <span class="hljs-string">"Hello Charlie, do Alice and Bob know about it?"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73863"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"emails/73863"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dES--C"</span>,
<span class="hljs-string">"content"</span> : <span class="hljs-string">"I think they don't know. Regards, Eve"</span>
}
]
</pre>
<div id="collectionFulltext_container_collapse" onclick="$('#collectionFulltext_long').hide(); $('#collectionFulltext_short').show(); window.location.hash='collectionFulltext_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionFulltext_short" onclick="$('#collectionFulltext_short').hide(); $('#collectionFulltext_long').show();">
<pre>
arangosh&gt; db.emails.ensureFulltextIndex(<span class="hljs-string">"content"</span>);
arangosh&gt; db.emails.save({ <span class="hljs-attr">content</span>:
........&gt; <span class="hljs-string">"Hello Alice, how are you doing? Regards, Bob"</span>});
arangosh&gt; db.emails.save({ <span class="hljs-attr">content</span>:
........&gt; <span class="hljs-string">"Hello Charlie, do Alice and Bob know about it?"</span>});
arangosh&gt; db.emails.save({ <span class="hljs-attr">content</span>: <span class="hljs-string">"I think they don't know. Regards, Eve"</span> });
arangosh&gt; db.emails.fulltext(<span class="hljs-string">"content"</span>, <span class="hljs-string">"charlie,|eve"</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionFulltext
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/administration-configuration.md -->
@startDocuBlockInline listCurrentConfigOpts
<div class="example-container" id="listCurrentConfigOpts_container">
<a class="anchorjs-link " href="#listCurrentConfigOpts_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="listCurrentConfigOpts_long" style="Display: none;">
<pre>
arangosh&gt; db._executeTransaction({ <span class="hljs-attr">collections</span>: {}, <span class="hljs-attr">action</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{<span class="hljs-keyword">return</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">"internal"</span>).options(); } })
{
<span class="hljs-string">"check-configuration"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"config"</span> : <span class="hljs-string">"/work/ArangoDB/etc/testing/arangod-single.conf"</span>,
<span class="hljs-string">"configuration"</span> : <span class="hljs-string">"/work/ArangoDB/etc/testing/arangod-single.conf"</span>,
<span class="hljs-string">"console"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"daemon"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"default-language"</span> : <span class="hljs-string">"en_US"</span>,
<span class="hljs-string">"define"</span> : [
<span class="hljs-string">"TOP_DIR=/work/ArangoDB"</span>
],
<span class="hljs-string">"dump-dependencies"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"dump-options"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fortune"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"gid"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"hund"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log"</span> : [
<span class="hljs-string">"info"</span>,
<span class="hljs-string">"info"</span>,
<span class="hljs-string">"replication=warn"</span>
],
<span class="hljs-string">"pid-file"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"supervisor"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"uid"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"working-directory"</span> : <span class="hljs-string">"/var/tmp"</span>,
<span class="hljs-string">"agency.activate"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"agency.compaction-keep-size"</span> : <span class="hljs-number">50000</span>,
<span class="hljs-string">"agency.compaction-step-size"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"agency.disaster-recovery-id"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"agency.election-timeout-max"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"agency.election-timeout-min"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"agency.endpoint"</span> : [ ],
<span class="hljs-string">"agency.max-append-size"</span> : <span class="hljs-number">250</span>,
<span class="hljs-string">"agency.my-address"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"agency.pool-size"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"agency.size"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"agency.supervision"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"agency.supervision-frequency"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"agency.supervision-grace-period"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"agency.wait-for-sync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"arangosearch.threads"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"arangosearch.threads-limit"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"audit.hostname"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"audit.output"</span> : [ ],
<span class="hljs-string">"backup.api-enabled"</span> : <span class="hljs-string">"true"</span>,
<span class="hljs-string">"backup.local-path-prefix"</span> : <span class="hljs-string">"/"</span>,
<span class="hljs-string">"cache.rebalancing-interval"</span> : <span class="hljs-number">2000000</span>,
<span class="hljs-string">"cache.size"</span> : <span class="hljs-number">16341606400</span>,
<span class="hljs-string">"cluster.agency-endpoint"</span> : [ ],
<span class="hljs-string">"cluster.agency-prefix"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"cluster.create-waits-for-sync-replication"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cluster.default-replication-factor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"cluster.index-create-timeout"</span> : <span class="hljs-number">3600</span>,
<span class="hljs-string">"cluster.max-number-of-shards"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"cluster.max-replication-factor"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"cluster.min-replication-factor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"cluster.my-address"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"cluster.my-advertised-endpoint"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"cluster.my-role"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"cluster.require-persisted-id"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cluster.resign-leadership-on-shutdown"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cluster.synchronous-replication-timeout-factor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"cluster.synchronous-replication-timeout-minimum"</span> : <span class="hljs-number">30</span>,
<span class="hljs-string">"cluster.synchronous-replication-timeout-per-4k"</span> : <span class="hljs-number">0.1</span>,
<span class="hljs-string">"cluster.system-replication-factor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"compaction.db-sleep-time"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"compaction.dead-documents-threshold"</span> : <span class="hljs-number">16384</span>,
<span class="hljs-string">"compaction.dead-size-percent-threshold"</span> : <span class="hljs-number">0.1</span>,
<span class="hljs-string">"compaction.dead-size-threshold"</span> : <span class="hljs-number">131072</span>,
<span class="hljs-string">"compaction.max-file-size-factor"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"compaction.max-files"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"compaction.max-result-file-size"</span> : <span class="hljs-number">134217728</span>,
<span class="hljs-string">"compaction.min-interval"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"compaction.min-small-data-file-size"</span> : <span class="hljs-number">131072</span>,
<span class="hljs-string">"database.auto-upgrade"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.check-version"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.directory"</span> : <span class="hljs-string">"/tmp/arangosh_JLhkMp/rocksdb-clusterOrNot/data"</span>,
<span class="hljs-string">"database.force-sync-properties"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.ignore-datafile-errors"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.init-database"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.maximal-journal-size"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"database.required-directory-state"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"database.restore-admin"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.throw-collection-not-loaded-error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"database.upgrade-check"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database.wait-for-sync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"foxx.api"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"foxx.queues"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"foxx.queues-poll-interval"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"foxx.store"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"frontend.proxy-request-check"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"frontend.trusted-proxy"</span> : [ ],
<span class="hljs-string">"frontend.version-check"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"http.allow-method-override"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"http.hide-product-header"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"http.keep-alive-timeout"</span> : <span class="hljs-number">300</span>,
<span class="hljs-string">"http.trusted-origin"</span> : [
<span class="hljs-string">"*"</span>
],
<span class="hljs-string">"javascript.allow-admin-execute"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"javascript.allow-external-process-control"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"javascript.allow-port-testing"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"javascript.app-path"</span> : <span class="hljs-string">"/tmp/arangosh_JLhkMp/rocksdb-clusterOrNot/apps"</span>,
<span class="hljs-string">"javascript.copy-installation"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"javascript.enabled"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"javascript.endpoints-blacklist"</span> : [ ],
<span class="hljs-string">"javascript.endpoints-whitelist"</span> : [ ],
<span class="hljs-string">"javascript.environment-variables-blacklist"</span> : [ ],
<span class="hljs-string">"javascript.environment-variables-whitelist"</span> : [ ],
<span class="hljs-string">"javascript.files-whitelist"</span> : [ ],
<span class="hljs-string">"javascript.gc-frequency"</span> : <span class="hljs-number">60</span>,
<span class="hljs-string">"javascript.gc-interval"</span> : <span class="hljs-number">2000</span>,
<span class="hljs-string">"javascript.harden"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"javascript.module-directory"</span> : [
<span class="hljs-string">"/work/ArangoDB/enterprise/js"</span>
],
<span class="hljs-string">"javascript.script"</span> : [ ],
<span class="hljs-string">"javascript.script-parameter"</span> : [ ],
<span class="hljs-string">"javascript.startup-directory"</span> : <span class="hljs-string">"/work/ArangoDB/js"</span>,
<span class="hljs-string">"javascript.startup-options-blacklist"</span> : [ ],
<span class="hljs-string">"javascript.startup-options-whitelist"</span> : [ ],
<span class="hljs-string">"javascript.v8-contexts"</span> : <span class="hljs-number">16</span>,
<span class="hljs-string">"javascript.v8-contexts-max-age"</span> : <span class="hljs-number">60</span>,
<span class="hljs-string">"javascript.v8-contexts-max-invocations"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"javascript.v8-contexts-minimum"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"javascript.v8-max-heap"</span> : <span class="hljs-number">3072</span>,
<span class="hljs-string">"javascript.v8-options"</span> : [ ],
<span class="hljs-string">"ldap.async-connect"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.basedn"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.binddn"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.debug"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.enabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.network-timeout"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ldap.port"</span> : <span class="hljs-number">389</span>,
<span class="hljs-string">"ldap.prefix"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.referrals"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.refresh-rate"</span> : <span class="hljs-number">300</span>,
<span class="hljs-string">"ldap.restart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.retries"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"ldap.roles-attribute-name"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.roles-exclude"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.roles-include"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.roles-search"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.roles-transformation"</span> : [ ],
<span class="hljs-string">"ldap.search-attribute"</span> : <span class="hljs-string">"uid"</span>,
<span class="hljs-string">"ldap.search-filter"</span> : <span class="hljs-string">"objectClass=*"</span>,
<span class="hljs-string">"ldap.search-scope"</span> : <span class="hljs-string">"sub"</span>,
<span class="hljs-string">"ldap.serialize-timeout"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"ldap.serialized"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.server"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.suffix"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.superuser-role"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.timeout"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ldap.tls"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ldap.tls-cacert-dir"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.tls-cacert-file"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ldap.tls-cert-check-strategy"</span> : <span class="hljs-string">"hard"</span>,
<span class="hljs-string">"ldap.tls-version"</span> : <span class="hljs-string">"1.2"</span>,
<span class="hljs-string">"ldap.url"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"log.color"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"log.escape"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"log.file"</span> : <span class="hljs-string">"/tmp/arangosh_JLhkMp/rocksdb-clusterOrNot/log"</span>,
<span class="hljs-string">"log.file-group"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"log.file-mode"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"log.force-direct"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.foreground-tty"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.ids"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"log.keep-logrotate"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.level"</span> : [
<span class="hljs-string">"info"</span>,
<span class="hljs-string">"info"</span>,
<span class="hljs-string">"replication=warn"</span>
],
<span class="hljs-string">"log.line-number"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.output"</span> : [
<span class="hljs-string">"file:///tmp/arangosh_JLhkMp/rocksdb-clusterOrNot/log"</span>
],
<span class="hljs-string">"log.performance"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.prefix"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"log.request-parameters"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"log.role"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"log.shorten-filenames"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"log.thread"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.thread-name"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.time-format"</span> : <span class="hljs-string">"utc-datestring"</span>,
<span class="hljs-string">"log.use-local-time"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"log.use-microtime"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"nonce.size"</span> : <span class="hljs-number">4194304</span>,
<span class="hljs-string">"query.cache-entries"</span> : <span class="hljs-number">128</span>,
<span class="hljs-string">"query.cache-entries-max-size"</span> : <span class="hljs-number">268435456</span>,
<span class="hljs-string">"query.cache-entry-max-size"</span> : <span class="hljs-number">16777216</span>,
<span class="hljs-string">"query.cache-include-system-collections"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"query.cache-mode"</span> : <span class="hljs-string">"off"</span>,
<span class="hljs-string">"query.fail-on-warning"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"query.memory-limit"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"query.optimizer-max-plans"</span> : <span class="hljs-number">128</span>,
<span class="hljs-string">"query.registry-ttl"</span> : <span class="hljs-number">30</span>,
<span class="hljs-string">"query.slow-streaming-threshold"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"query.slow-threshold"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"query.smart-joins"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"query.tracking"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"query.tracking-with-bindvars"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"random.generator"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"rclone.executable"</span> : <span class="hljs-string">"rclone-arangodb"</span>,
<span class="hljs-string">"replication.active-failover"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"replication.auto-start"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"replication.automatic-failover"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"replication.max-parallel-tailing-invocations"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"rocksdb.allow-fallocate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"rocksdb.block-align-data-blocks"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.block-cache-shard-bits"</span> : <span class="hljs-number">-1</span>,
<span class="hljs-string">"rocksdb.block-cache-size"</span> : <span class="hljs-number">19609927680</span>,
<span class="hljs-string">"rocksdb.compaction-read-ahead-size"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"rocksdb.create-sha-files"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"rocksdb.debug-logging"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.delayed-write-rate"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"rocksdb.dynamic-level-bytes"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"rocksdb.enable-pipelined-write"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.enable-statistics"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.encryption-key-generator"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"rocksdb.encryption-keyfile"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"rocksdb.enforce-block-cache-size-limit"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.intermediate-commit-count"</span> : <span class="hljs-number">1000000</span>,
<span class="hljs-string">"rocksdb.intermediate-commit-size"</span> : <span class="hljs-number">536870912</span>,
<span class="hljs-string">"rocksdb.level0-compaction-trigger"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"rocksdb.level0-slowdown-trigger"</span> : <span class="hljs-number">20</span>,
<span class="hljs-string">"rocksdb.level0-stop-trigger"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rocksdb.limit-open-files-at-startup"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.max-background-jobs"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"rocksdb.max-bytes-for-level-base"</span> : <span class="hljs-number">268435456</span>,
<span class="hljs-string">"rocksdb.max-bytes-for-level-multiplier"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"rocksdb.max-subcompactions"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"rocksdb.max-total-wal-size"</span> : <span class="hljs-number">83886080</span>,
<span class="hljs-string">"rocksdb.max-transaction-size"</span> : <span class="hljs-number">18446744073709552000</span>,
<span class="hljs-string">"rocksdb.max-write-buffer-number"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"rocksdb.min-write-buffer-number-to-merge"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"rocksdb.num-levels"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"rocksdb.num-threads-priority-high"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"rocksdb.num-threads-priority-low"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"rocksdb.num-uncompressed-levels"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"rocksdb.optimize-filters-for-hits"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.recycle-log-file-num"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.sync-interval"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"rocksdb.table-block-size"</span> : <span class="hljs-number">16384</span>,
<span class="hljs-string">"rocksdb.throttle"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"rocksdb.total-write-buffer-size"</span> : <span class="hljs-number">26146570240</span>,
<span class="hljs-string">"rocksdb.transaction-lock-timeout"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"rocksdb.use-direct-io-for-flush-and-compaction"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.use-direct-reads"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.use-file-logging"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.use-fsync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.wal-archive-size-limit"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"rocksdb.wal-directory"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"rocksdb.wal-file-timeout"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"rocksdb.wal-file-timeout-initial"</span> : <span class="hljs-number">180</span>,
<span class="hljs-string">"rocksdb.wal-recovery-skip-corrupted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"rocksdb.write-buffer-size"</span> : <span class="hljs-number">67108864</span>,
<span class="hljs-string">"server.allow-use-database"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.authentication"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"server.authentication-system-only"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.authentication-timeout"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"server.authentication-unix-sockets"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.check-max-memory-mappings"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.descriptors-minimum"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"server.endpoint"</span> : [
<span class="hljs-string">"tcp://127.0.0.1:30361"</span>
],
<span class="hljs-string">"server.flush-interval"</span> : <span class="hljs-number">1000000</span>,
<span class="hljs-string">"server.gid"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"server.harden"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"server.io-threads"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"server.local-authentication"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.maintenance-actions-block"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"server.maintenance-actions-linger"</span> : <span class="hljs-number">3600</span>,
<span class="hljs-string">"server.maintenance-threads"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"server.maximal-queue-size"</span> : <span class="hljs-number">4096</span>,
<span class="hljs-string">"server.maximal-threads"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"server.minimal-threads"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"server.prio1-size"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"server.rest-server"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.scheduler-queue-size"</span> : <span class="hljs-number">128</span>,
<span class="hljs-string">"server.statistics"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.statistics-history"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"server.storage-engine"</span> : <span class="hljs-string">"rocksdb"</span>,
<span class="hljs-string">"server.uid"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ssl.cafile"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"ssl.cipher-list"</span> : <span class="hljs-string">"HIGH:!EXPORT:!aNULL@STRENGTH"</span>,
<span class="hljs-string">"ssl.ecdh-curve"</span> : <span class="hljs-string">"prime256v1"</span>,
<span class="hljs-string">"ssl.keyfile"</span> : <span class="hljs-string">"/work/ArangoDB/UnitTests/server.pem"</span>,
<span class="hljs-string">"ssl.options"</span> : <span class="hljs-number">2147485780</span>,
<span class="hljs-string">"ssl.protocol"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"ssl.require-peer-certificate"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"ssl.session-cache"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"tcp.backlog-size"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"tcp.reuse-address"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"temp.path"</span> : <span class="hljs-string">"/tmp/arangosh_JLhkMp/rocksdb-clusterOrNot/tmp"</span>,
<span class="hljs-string">"ttl.frequency"</span> : <span class="hljs-number">30000</span>,
<span class="hljs-string">"ttl.max-collection-removes"</span> : <span class="hljs-number">1000000</span>,
<span class="hljs-string">"ttl.max-total-removes"</span> : <span class="hljs-number">1000000</span>,
<span class="hljs-string">"ttl.only-loaded-collection"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"vst.maxsize"</span> : <span class="hljs-number">30720</span>,
<span class="hljs-string">"wal.allow-oversize-entries"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"wal.directory"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"wal.flush-timeout"</span> : <span class="hljs-number">30000</span>,
<span class="hljs-string">"wal.historic-logfiles"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"wal.ignore-logfile-errors"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"wal.ignore-recovery-errors"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"wal.logfile-size"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"wal.open-logfiles"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"wal.reserve-logfiles"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"wal.slots"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"wal.sync-interval"</span> : <span class="hljs-number">100000</span>,
<span class="hljs-string">"wal.throttle-wait"</span> : <span class="hljs-number">15000</span>,
<span class="hljs-string">"wal.throttle-when-pending"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"wal.use-mlock"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="listCurrentConfigOpts_container_collapse" onclick="$('#listCurrentConfigOpts_long').hide(); $('#listCurrentConfigOpts_short').show(); window.location.hash='listCurrentConfigOpts_container';" class="example_show_button">Hide execution results</div></div>
<div id="listCurrentConfigOpts_short" onclick="$('#listCurrentConfigOpts_short').hide(); $('#listCurrentConfigOpts_long').show();">
<pre>
arangosh&gt; db._executeTransaction({ <span class="hljs-attr">collections</span>: {}, <span class="hljs-attr">action</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{<span class="hljs-keyword">return</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">"internal"</span>).options(); } })
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock listCurrentConfigOpts
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseNameKnown
<div class="example-container" id="collectionDatabaseNameKnown_container">
<a class="anchorjs-link " href="#collectionDatabaseNameKnown_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseNameKnown_long">
<pre>
arangosh&gt; db._collection(<span class="hljs-string">"demo"</span>);
[ArangoCollection <span class="hljs-number">102</span>, <span class="hljs-string">"demo"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
</pre>
</div>
</div>
@endDocuBlock collectionDatabaseNameKnown
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseNameUnknown
<div class="example-container" id="collectionDatabaseNameUnknown_container">
<a class="anchorjs-link " href="#collectionDatabaseNameUnknown_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseNameUnknown_long">
<pre>
arangosh&gt; db._collection(<span class="hljs-string">"unknown"</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock collectionDatabaseNameUnknown
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseCreateSuccess
<div class="example-container" id="collectionDatabaseCreateSuccess_container">
<a class="anchorjs-link " href="#collectionDatabaseCreateSuccess_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseCreateSuccess_long" style="Display: none;">
<pre>
arangosh&gt; c = db._create(<span class="hljs-string">"users"</span>);
[ArangoCollection <span class="hljs-number">73732</span>, <span class="hljs-string">"users"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; c.properties();
{
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="collectionDatabaseCreateSuccess_container_collapse" onclick="$('#collectionDatabaseCreateSuccess_long').hide(); $('#collectionDatabaseCreateSuccess_short').show(); window.location.hash='collectionDatabaseCreateSuccess_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionDatabaseCreateSuccess_short" onclick="$('#collectionDatabaseCreateSuccess_short').hide(); $('#collectionDatabaseCreateSuccess_long').show();">
<pre>
arangosh&gt; c = db._create(<span class="hljs-string">"users"</span>);
arangosh&gt; c.properties();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionDatabaseCreateSuccess
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseCreateProperties
<div class="example-container" id="collectionDatabaseCreateProperties_container">
<a class="anchorjs-link " href="#collectionDatabaseCreateProperties_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseCreateProperties_long" style="Display: none;">
<pre>
arangosh&gt; c = db._create(<span class="hljs-string">"users"</span>, { <span class="hljs-attr">waitForSync</span> : <span class="hljs-literal">true</span>,
........&gt; journalSize : <span class="hljs-number">1024</span> * <span class="hljs-number">1204</span>});
[ArangoCollection <span class="hljs-number">73712</span>, <span class="hljs-string">"users"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; c.properties();
{
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="collectionDatabaseCreateProperties_container_collapse" onclick="$('#collectionDatabaseCreateProperties_long').hide(); $('#collectionDatabaseCreateProperties_short').show(); window.location.hash='collectionDatabaseCreateProperties_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionDatabaseCreateProperties_short" onclick="$('#collectionDatabaseCreateProperties_short').hide(); $('#collectionDatabaseCreateProperties_long').show();">
<pre>
arangosh&gt; c = db._create(<span class="hljs-string">"users"</span>, { <span class="hljs-attr">waitForSync</span> : <span class="hljs-literal">true</span>,
........&gt; journalSize : <span class="hljs-number">1024</span> * <span class="hljs-number">1204</span>});
arangosh&gt; c.properties();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionDatabaseCreateProperties
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseCreateKey
<div class="example-container" id="collectionDatabaseCreateKey_container">
<a class="anchorjs-link " href="#collectionDatabaseCreateKey_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseCreateKey_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"users"</span>,
........&gt; { <span class="hljs-attr">keyOptions</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"autoincrement"</span>, <span class="hljs-attr">offset</span>: <span class="hljs-number">10</span>, <span class="hljs-attr">increment</span>: <span class="hljs-number">5</span> } });
[ArangoCollection <span class="hljs-number">73702</span>, <span class="hljs-string">"users"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 1"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/10"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"10"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6cxO--A"</span>
}
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 2"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/15"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"15"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6cxO--C"</span>
}
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 3"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/20"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"20"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6cxS---"</span>
}
</pre>
<div id="collectionDatabaseCreateKey_container_collapse" onclick="$('#collectionDatabaseCreateKey_long').hide(); $('#collectionDatabaseCreateKey_short').show(); window.location.hash='collectionDatabaseCreateKey_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionDatabaseCreateKey_short" onclick="$('#collectionDatabaseCreateKey_short').hide(); $('#collectionDatabaseCreateKey_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"users"</span>,
........&gt; { <span class="hljs-attr">keyOptions</span>: { <span class="hljs-attr">type</span>: <span class="hljs-string">"autoincrement"</span>, <span class="hljs-attr">offset</span>: <span class="hljs-number">10</span>, <span class="hljs-attr">increment</span>: <span class="hljs-number">5</span> } });
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 1"</span> });
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 2"</span> });
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 3"</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionDatabaseCreateKey
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseCreateSpecialKey
<div class="example-container" id="collectionDatabaseCreateSpecialKey_container">
<a class="anchorjs-link " href="#collectionDatabaseCreateSpecialKey_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseCreateSpecialKey_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"users"</span>, { <span class="hljs-attr">keyOptions</span>: { <span class="hljs-attr">allowUserKeys</span>: <span class="hljs-literal">false</span> } });
[ArangoCollection <span class="hljs-number">73720</span>, <span class="hljs-string">"users"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 1"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/73725"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73725"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6cxq--A"</span>
}
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 2"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"myuser"</span> });
[ArangoError <span class="hljs-number">1222</span>: unexpected <span class="hljs-built_in">document</span> key]
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 3"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/73728"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73728"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6cxu---"</span>
}
</pre>
<div id="collectionDatabaseCreateSpecialKey_container_collapse" onclick="$('#collectionDatabaseCreateSpecialKey_long').hide(); $('#collectionDatabaseCreateSpecialKey_short').show(); window.location.hash='collectionDatabaseCreateSpecialKey_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionDatabaseCreateSpecialKey_short" onclick="$('#collectionDatabaseCreateSpecialKey_short').hide(); $('#collectionDatabaseCreateSpecialKey_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"users"</span>, { <span class="hljs-attr">keyOptions</span>: { <span class="hljs-attr">allowUserKeys</span>: <span class="hljs-literal">false</span> } });
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 1"</span> });
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 2"</span>, <span class="hljs-attr">_key</span>: <span class="hljs-string">"myuser"</span> });
arangosh&gt; db.users.save({ <span class="hljs-attr">name</span>: <span class="hljs-string">"user 3"</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionDatabaseCreateSpecialKey
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionsDatabaseName
<div class="example-container" id="collectionsDatabaseName_container">
<a class="anchorjs-link " href="#collectionsDatabaseName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionsDatabaseName_long" style="Display: none;">
<pre>
arangosh&gt; db._collections();
[
[ArangoCollection <span class="hljs-number">19</span>, <span class="hljs-string">"_analyzers"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">34</span>, <span class="hljs-string">"_appbundles"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">31</span>, <span class="hljs-string">"_apps"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">22</span>, <span class="hljs-string">"_aqlfunctions"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">43</span>, <span class="hljs-string">"_fishbowl"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">37</span>, <span class="hljs-string">"_frontend"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">7</span>, <span class="hljs-string">"_graphs"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">28</span>, <span class="hljs-string">"_jobs"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">40</span>, <span class="hljs-string">"_modules"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">25</span>, <span class="hljs-string">"_queues"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">10</span>, <span class="hljs-string">"_statistics"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">13</span>, <span class="hljs-string">"_statistics15"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">16</span>, <span class="hljs-string">"_statisticsRaw"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">4</span>, <span class="hljs-string">"_users"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">108</span>, <span class="hljs-string">"animals"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">102</span>, <span class="hljs-string">"demo"</span> (type <span class="hljs-built_in">document</span>, status loaded)],
[ArangoCollection <span class="hljs-number">73971</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
]
</pre>
<div id="collectionsDatabaseName_container_collapse" onclick="$('#collectionsDatabaseName_long').hide(); $('#collectionsDatabaseName_short').show(); window.location.hash='collectionsDatabaseName_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionsDatabaseName_short" onclick="$('#collectionsDatabaseName_short').hide(); $('#collectionsDatabaseName_long').show();">
<pre>
arangosh&gt; db._collections();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionsDatabaseName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseCollectionName
<div class="example-container" id="collectionDatabaseCollectionName_container">
<a class="anchorjs-link " href="#collectionDatabaseCollectionName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseCollectionName_long">
<pre>
arangosh&gt; db.example;
[ArangoCollection <span class="hljs-number">73687</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
</pre>
</div>
</div>
@endDocuBlock collectionDatabaseCollectionName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseDropByObject
<div class="example-container" id="collectionDatabaseDropByObject_container">
<a class="anchorjs-link " href="#collectionDatabaseDropByObject_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseDropByObject_long">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73747</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._drop(col);
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">73747</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
</pre>
</div>
</div>
@endDocuBlock collectionDatabaseDropByObject
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseDropName
<div class="example-container" id="collectionDatabaseDropName_container">
<a class="anchorjs-link " href="#collectionDatabaseDropName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseDropName_long">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73754</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._drop(<span class="hljs-string">"example"</span>);
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">73754</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status deleted)]
</pre>
</div>
</div>
@endDocuBlock collectionDatabaseDropName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseDropSystem
<div class="example-container" id="collectionDatabaseDropSystem_container">
<a class="anchorjs-link " href="#collectionDatabaseDropSystem_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseDropSystem_long">
<pre>
arangosh&gt; col = db._example;
[ArangoCollection <span class="hljs-number">73761</span>, <span class="hljs-string">"_example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db._drop(<span class="hljs-string">"_example"</span>, { <span class="hljs-attr">isSystem</span>: <span class="hljs-literal">true</span> });
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">73761</span>, <span class="hljs-string">"_example"</span> (type <span class="hljs-built_in">document</span>, status deleted)]
</pre>
</div>
</div>
@endDocuBlock collectionDatabaseDropSystem
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseTruncateByObject
<div class="example-container" id="collectionDatabaseTruncateByObject_container">
<a class="anchorjs-link " href="#collectionDatabaseTruncateByObject_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseTruncateByObject_long" style="Display: none;">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73782</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.save({ <span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/73787"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73787"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6c5C--A"</span>
}
arangosh&gt; col.count();
<span class="hljs-number">1</span>
arangosh&gt; db._truncate(col);
arangosh&gt; col.count();
<span class="hljs-number">0</span>
</pre>
<div id="collectionDatabaseTruncateByObject_container_collapse" onclick="$('#collectionDatabaseTruncateByObject_long').hide(); $('#collectionDatabaseTruncateByObject_short').show(); window.location.hash='collectionDatabaseTruncateByObject_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionDatabaseTruncateByObject_short" onclick="$('#collectionDatabaseTruncateByObject_short').hide(); $('#collectionDatabaseTruncateByObject_long').show();">
<pre>
arangosh&gt; col = db.example;
arangosh&gt; col.save({ <span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span> });
arangosh&gt; col.count();
arangosh&gt; db._truncate(col);
arangosh&gt; col.count();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionDatabaseTruncateByObject
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-database-methods.md -->
@startDocuBlockInline collectionDatabaseTruncateName
<div class="example-container" id="collectionDatabaseTruncateName_container">
<a class="anchorjs-link " href="#collectionDatabaseTruncateName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDatabaseTruncateName_long" style="Display: none;">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73794</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.save({ <span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/73799"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73799"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6c9e---"</span>
}
arangosh&gt; col.count();
<span class="hljs-number">1</span>
arangosh&gt; db._truncate(<span class="hljs-string">"example"</span>);
arangosh&gt; col.count();
<span class="hljs-number">0</span>
</pre>
<div id="collectionDatabaseTruncateName_container_collapse" onclick="$('#collectionDatabaseTruncateName_long').hide(); $('#collectionDatabaseTruncateName_short').show(); window.location.hash='collectionDatabaseTruncateName_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionDatabaseTruncateName_short" onclick="$('#collectionDatabaseTruncateName_short').hide(); $('#collectionDatabaseTruncateName_long').show();">
<pre>
arangosh&gt; col = db.example;
arangosh&gt; col.save({ <span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span> });
arangosh&gt; col.count();
arangosh&gt; db._truncate(<span class="hljs-string">"example"</span>);
arangosh&gt; col.count();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionDatabaseTruncateName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline collectionDrop
<div class="example-container" id="collectionDrop_container">
<a class="anchorjs-link " href="#collectionDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDrop_long">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73806</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.drop();
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">73806</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status deleted)]
</pre>
</div>
</div>
@endDocuBlock collectionDrop
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline collectionDropSystem
<div class="example-container" id="collectionDropSystem_container">
<a class="anchorjs-link " href="#collectionDropSystem_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionDropSystem_long">
<pre>
arangosh&gt; col = db._example;
[ArangoCollection <span class="hljs-number">73813</span>, <span class="hljs-string">"_example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.drop({ <span class="hljs-attr">isSystem</span>: <span class="hljs-literal">true</span> });
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">73813</span>, <span class="hljs-string">"_example"</span> (type <span class="hljs-built_in">document</span>, status deleted)]
</pre>
</div>
</div>
@endDocuBlock collectionDropSystem
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline collectionTruncate
<div class="example-container" id="collectionTruncate_container">
<a class="anchorjs-link " href="#collectionTruncate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionTruncate_long" style="Display: none;">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73959</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.save({ <span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/73964"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"73964"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dGW---"</span>
}
arangosh&gt; col.count();
<span class="hljs-number">1</span>
arangosh&gt; col.truncate();
arangosh&gt; col.count();
<span class="hljs-number">0</span>
</pre>
<div id="collectionTruncate_container_collapse" onclick="$('#collectionTruncate_long').hide(); $('#collectionTruncate_short').show(); window.location.hash='collectionTruncate_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionTruncate_short" onclick="$('#collectionTruncate_short').hide(); $('#collectionTruncate_long').show();">
<pre>
arangosh&gt; col = db.example;
arangosh&gt; col.save({ <span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span> });
arangosh&gt; col.count();
arangosh&gt; col.truncate();
arangosh&gt; col.count();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionTruncate
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline collectionFigures
<div class="example-container" id="collectionFigures_container">
<a class="anchorjs-link " href="#collectionFigures_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionFigures_long" style="Display: none;">
<pre>
arangosh&gt; db.demo.figures()
{
<span class="hljs-string">"indexes"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">1590</span>
},
<span class="hljs-string">"documentsSize"</span> : <span class="hljs-number">2946</span>,
<span class="hljs-string">"cacheInUse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cacheSize"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"cacheUsage"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="collectionFigures_container_collapse" onclick="$('#collectionFigures_long').hide(); $('#collectionFigures_short').show(); window.location.hash='collectionFigures_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionFigures_short" onclick="$('#collectionFigures_short').hide(); $('#collectionFigures_long').show();">
<pre>
arangosh&gt; db.demo.figures()
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock collectionFigures
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline collectionLoad
<div class="example-container" id="collectionLoad_container">
<a class="anchorjs-link " href="#collectionLoad_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionLoad_long">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">73890</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.load();
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">73890</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
</pre>
</div>
</div>
@endDocuBlock collectionLoad
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline CollectionUnload
<div class="example-container" id="CollectionUnload_container">
<a class="anchorjs-link " href="#CollectionUnload_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="CollectionUnload_long">
<pre>
arangosh&gt; col = db.example;
[ArangoCollection <span class="hljs-number">65367</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; col.unload();
arangosh&gt; col;
[ArangoCollection <span class="hljs-number">65367</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status unloaded)]
</pre>
</div>
</div>
@endDocuBlock CollectionUnload
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-collections-collection-methods.md -->
@startDocuBlockInline collectionRename
<div class="example-container" id="collectionRename_container">
<a class="anchorjs-link " href="#collectionRename_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionRename_long">
<pre>
arangosh&gt; c = db.example;
[ArangoCollection <span class="hljs-number">73952</span>, <span class="hljs-string">"example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; c.rename(<span class="hljs-string">"better-example"</span>);
arangosh&gt; c;
[ArangoCollection <span class="hljs-number">73952</span>, <span class="hljs-string">"better-example"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
</pre>
</div>
</div>
@endDocuBlock collectionRename
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-database-methods.md -->
@startDocuBlockInline documentsDocumentName
<div class="example-container" id="documentsDocumentName_container">
<a class="anchorjs-link " href="#documentsDocumentName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsDocumentName_long" style="Display: none;">
<pre>
arangosh&gt; db._document(<span class="hljs-string">"example/12345"</span>);
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"12345"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/12345"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dTK--A"</span>
}
</pre>
<div id="documentsDocumentName_container_collapse" onclick="$('#documentsDocumentName_long').hide(); $('#documentsDocumentName_short').show(); window.location.hash='documentsDocumentName_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsDocumentName_short" onclick="$('#documentsDocumentName_short').hide(); $('#documentsDocumentName_long').show();">
<pre>
arangosh&gt; db._document(<span class="hljs-string">"example/12345"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsDocumentName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-database-methods.md -->
@startDocuBlockInline documentsDocumentReplace
<div class="example-container" id="documentsDocumentReplace_container">
<a class="anchorjs-link " href="#documentsDocumentReplace_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsDocumentReplace_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74422"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74422"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dTW---"</span>
}
arangosh&gt; a2 = db._replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74422"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74422"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dTW--B"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dTW---"</span>
}
arangosh&gt; a3 = db._replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">3</span> });
[ArangoError <span class="hljs-number">1200</span>: precondition failed]
</pre>
<div id="documentsDocumentReplace_container_collapse" onclick="$('#documentsDocumentReplace_long').hide(); $('#documentsDocumentReplace_short').show(); window.location.hash='documentsDocumentReplace_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsDocumentReplace_short" onclick="$('#documentsDocumentReplace_short').hide(); $('#documentsDocumentReplace_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; a2 = db._replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
arangosh&gt; a3 = db._replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">3</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsDocumentReplace
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-database-methods.md -->
@startDocuBlockInline documentDocumentUpdate
<div class="example-container" id="documentDocumentUpdate_container">
<a class="anchorjs-link " href="#documentDocumentUpdate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentDocumentUpdate_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74117"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74117"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNC--A"</span>
}
arangosh&gt; a2 = db._update(a1, { <span class="hljs-attr">b</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74117"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74117"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dNG--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dNC--A"</span>
}
arangosh&gt; a3 = db._update(a1, { <span class="hljs-attr">c</span> : <span class="hljs-number">3</span> });
[ArangoError <span class="hljs-number">1200</span>: precondition failed]
</pre>
<div id="documentDocumentUpdate_container_collapse" onclick="$('#documentDocumentUpdate_long').hide(); $('#documentDocumentUpdate_short').show(); window.location.hash='documentDocumentUpdate_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentDocumentUpdate_short" onclick="$('#documentDocumentUpdate_short').hide(); $('#documentDocumentUpdate_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; a2 = db._update(a1, { <span class="hljs-attr">b</span> : <span class="hljs-number">2</span> });
arangosh&gt; a3 = db._update(a1, { <span class="hljs-attr">c</span> : <span class="hljs-number">3</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentDocumentUpdate
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-database-methods.md -->
@startDocuBlockInline documentsCollectionRemoveSuccess
<div class="example-container" id="documentsCollectionRemoveSuccess_container">
<a class="anchorjs-link " href="#documentsCollectionRemoveSuccess_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionRemoveSuccess_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74256"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74256"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dQ----"</span>
}
arangosh&gt; db._remove(a1);
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74256"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74256"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dQ----"</span>
}
arangosh&gt; db._remove(a1);
[ArangoError <span class="hljs-number">1202</span>: <span class="hljs-built_in">document</span> not found]
arangosh&gt; db._remove(a1, {<span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>});
[ArangoError <span class="hljs-number">1202</span>: <span class="hljs-built_in">document</span> not found]
</pre>
<div id="documentsCollectionRemoveSuccess_container_collapse" onclick="$('#documentsCollectionRemoveSuccess_long').hide(); $('#documentsCollectionRemoveSuccess_short').show(); window.location.hash='documentsCollectionRemoveSuccess_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionRemoveSuccess_short" onclick="$('#documentsCollectionRemoveSuccess_short').hide(); $('#documentsCollectionRemoveSuccess_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; db._remove(a1);
arangosh&gt; db._remove(a1);
arangosh&gt; db._remove(a1, {<span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionRemoveSuccess
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-database-methods.md -->
@startDocuBlockInline documentsCollectionRemoveConflict
<div class="example-container" id="documentsCollectionRemoveConflict_container">
<a class="anchorjs-link " href="#documentsCollectionRemoveConflict_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionRemoveConflict_long" style="Display: none;">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74234"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74234"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPe--A"</span>
}
arangosh&gt; a2 = db._replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74234"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74234"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPi--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6dPe--A"</span>
}
arangosh&gt; db._remove(a1);
[ArangoError <span class="hljs-number">1200</span>: precondition failed]
arangosh&gt; db._remove(a1, {<span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>} );
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/74234"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74234"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPi--_"</span>
}
arangosh&gt; db._document(a1);
[ArangoError <span class="hljs-number">1202</span>: <span class="hljs-built_in">document</span> not found]
</pre>
<div id="documentsCollectionRemoveConflict_container_collapse" onclick="$('#documentsCollectionRemoveConflict_long').hide(); $('#documentsCollectionRemoveConflict_short').show(); window.location.hash='documentsCollectionRemoveConflict_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionRemoveConflict_short" onclick="$('#documentsCollectionRemoveConflict_short').hide(); $('#documentsCollectionRemoveConflict_long').show();">
<pre>
arangosh&gt; a1 = db.example.insert({ <span class="hljs-attr">a</span> : <span class="hljs-number">1</span> });
arangosh&gt; a2 = db._replace(a1, { <span class="hljs-attr">a</span> : <span class="hljs-number">2</span> });
arangosh&gt; db._remove(a1);
arangosh&gt; db._remove(a1, {<span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>} );
arangosh&gt; db._document(a1);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionRemoveConflict
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-documents-database-methods.md -->
@startDocuBlockInline documentsCollectionRemoveSignature
<div class="example-container" id="documentsCollectionRemoveSignature_container">
<a class="anchorjs-link " href="#documentsCollectionRemoveSignature_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="documentsCollectionRemoveSignature_long" style="Display: none;">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"11265325374"</span>, <span class="hljs-attr">a</span>: <span class="hljs-number">1</span> } );
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/11265325374"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"11265325374"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPy---"</span>
}
arangosh&gt; db.example.remove(<span class="hljs-string">"example/11265325374"</span>,
........&gt; { <span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">waitForSync</span>: <span class="hljs-literal">false</span>})
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"example/11265325374"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"11265325374"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dPy---"</span>
}
</pre>
<div id="documentsCollectionRemoveSignature_container_collapse" onclick="$('#documentsCollectionRemoveSignature_long').hide(); $('#documentsCollectionRemoveSignature_short').show(); window.location.hash='documentsCollectionRemoveSignature_container';" class="example_show_button">Hide execution results</div></div>
<div id="documentsCollectionRemoveSignature_short" onclick="$('#documentsCollectionRemoveSignature_short').hide(); $('#documentsCollectionRemoveSignature_long').show();">
<pre>
arangosh&gt; db.example.insert({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"11265325374"</span>, <span class="hljs-attr">a</span>: <span class="hljs-number">1</span> } );
arangosh&gt; db.example.remove(<span class="hljs-string">"example/11265325374"</span>,
........&gt; { <span class="hljs-attr">overwrite</span>: <span class="hljs-literal">true</span>, <span class="hljs-attr">waitForSync</span>: <span class="hljs-literal">false</span>})
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock documentsCollectionRemoveSignature
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-references-cursor-object.md -->
@startDocuBlockInline cursorHasNext
<div class="example-container" id="cursorHasNext_container">
<a class="anchorjs-link " href="#cursorHasNext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="cursorHasNext_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> a = db._query(<span class="hljs-string">"FOR x IN five RETURN x"</span>);
arangosh&gt; <span class="hljs-keyword">while</span> (a.hasNext()) print(a.next());
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74040"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/74040"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dLq--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74042"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/74042"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dLq--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"two"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74044"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/74044"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dLq--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"three"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74046"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/74046"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dLu---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"four"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74048"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/74048"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dLu--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"five"</span>
}
</pre>
<div id="cursorHasNext_container_collapse" onclick="$('#cursorHasNext_long').hide(); $('#cursorHasNext_short').show(); window.location.hash='cursorHasNext_container';" class="example_show_button">Hide execution results</div></div>
<div id="cursorHasNext_short" onclick="$('#cursorHasNext_short').hide(); $('#cursorHasNext_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> a = db._query(<span class="hljs-string">"FOR x IN five RETURN x"</span>);
arangosh&gt; <span class="hljs-keyword">while</span> (a.hasNext()) print(a.next());
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock cursorHasNext
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-references-cursor-object.md -->
@startDocuBlockInline cursorNext
<div class="example-container" id="cursorNext_container">
<a class="anchorjs-link " href="#cursorNext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="cursorNext_long" style="Display: none;">
<pre>
arangosh&gt; db._query(<span class="hljs-string">"FOR x IN five RETURN x"</span>).next();
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74058"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"five/74058"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dL6--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"one"</span>
}
</pre>
<div id="cursorNext_container_collapse" onclick="$('#cursorNext_long').hide(); $('#cursorNext_short').show(); window.location.hash='cursorNext_container';" class="example_show_button">Hide execution results</div></div>
<div id="cursorNext_short" onclick="$('#cursorNext_short').hide(); $('#cursorNext_long').show();">
<pre>
arangosh&gt; db._query(<span class="hljs-string">"FOR x IN five RETURN x"</span>).next();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock cursorNext
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-references-cursor-object.md -->
@startDocuBlockInline executeQueryNoBatchSize
<div class="example-container" id="executeQueryNoBatchSize_container">
<a class="anchorjs-link " href="#executeQueryNoBatchSize_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="executeQueryNoBatchSize_long" style="Display: none;">
<pre>
arangosh&gt; result = db.users.all().toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74958"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74958"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6da---A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74960"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74960"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6da---C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Helmut"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74962"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74962"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6da---E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span>
}
]
arangosh&gt; <span class="hljs-keyword">var</span> q = db._query(<span class="hljs-string">"FOR x IN users RETURN x"</span>);
........&gt; result = [ ];
........&gt; <span class="hljs-keyword">while</span> (q.hasNext()) {
........&gt; result.push(q.next());
........&gt; }
</pre>
<div id="executeQueryNoBatchSize_container_collapse" onclick="$('#executeQueryNoBatchSize_long').hide(); $('#executeQueryNoBatchSize_short').show(); window.location.hash='executeQueryNoBatchSize_container';" class="example_show_button">Hide execution results</div></div>
<div id="executeQueryNoBatchSize_short" onclick="$('#executeQueryNoBatchSize_short').hide(); $('#executeQueryNoBatchSize_long').show();">
<pre>
arangosh&gt; result = db.users.all().toArray();
arangosh&gt; <span class="hljs-keyword">var</span> q = db._query(<span class="hljs-string">"FOR x IN users RETURN x"</span>);
........&gt; result = [ ];
........&gt; <span class="hljs-keyword">while</span> (q.hasNext()) {
........&gt; result.push(q.next());
........&gt; }
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock executeQueryNoBatchSize
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-references-cursor-object.md -->
@startDocuBlockInline executeQueryBatchSize
<div class="example-container" id="executeQueryBatchSize_container">
<a class="anchorjs-link " href="#executeQueryBatchSize_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="executeQueryBatchSize_long" style="Display: none;">
<pre>
arangosh&gt; q = db.users.all(); q.setBatchSize(<span class="hljs-number">20</span>); q.execute(); <span class="hljs-keyword">while</span> (q.hasNext()) { print(q.next()); }
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74941"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74941"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZq--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74943"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74943"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZq--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Helmut"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74945"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74945"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZu---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span>
}
SimpleQueryAll(users)
arangosh&gt; q = db.users.all(); q.execute(<span class="hljs-number">20</span>); <span class="hljs-keyword">while</span> (q.hasNext()) { print(q.next()); }
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74941"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74941"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZq--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Gerhard"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74943"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74943"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZq--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Helmut"</span>
}
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"74945"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"users/74945"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6dZu---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Angela"</span>
}
SimpleQueryAll(users)
</pre>
<div id="executeQueryBatchSize_container_collapse" onclick="$('#executeQueryBatchSize_long').hide(); $('#executeQueryBatchSize_short').show(); window.location.hash='executeQueryBatchSize_container';" class="example_show_button">Hide execution results</div></div>
<div id="executeQueryBatchSize_short" onclick="$('#executeQueryBatchSize_short').hide(); $('#executeQueryBatchSize_long').show();">
<pre>
arangosh&gt; q = db.users.all(); q.setBatchSize(<span class="hljs-number">20</span>); q.execute(); <span class="hljs-keyword">while</span> (q.hasNext()) { print(q.next()); }
arangosh&gt; q = db.users.all(); q.execute(<span class="hljs-number">20</span>); <span class="hljs-keyword">while</span> (q.hasNext()) { print(q.next()); }
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock executeQueryBatchSize
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerCreate
<div class="example-container" id="analyzerCreate_container">
<a class="anchorjs-link " href="#analyzerCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerCreate_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.save(<span class="hljs-string">"csv"</span>, <span class="hljs-string">"delimiter"</span>, { <span class="hljs-string">"delimiter"</span>: <span class="hljs-string">","</span> }, []);
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::csv"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"delimiter"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"delimiter"</span> : <span class="hljs-string">","</span>
},
<span class="hljs-string">"features"</span> : [ ]
}
</pre>
<div id="analyzerCreate_container_collapse" onclick="$('#analyzerCreate_long').hide(); $('#analyzerCreate_short').show(); window.location.hash='analyzerCreate_container';" class="example_show_button">Hide execution results</div></div>
<div id="analyzerCreate_short" onclick="$('#analyzerCreate_short').hide(); $('#analyzerCreate_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.save(<span class="hljs-string">"csv"</span>, <span class="hljs-string">"delimiter"</span>, { <span class="hljs-string">"delimiter"</span>: <span class="hljs-string">","</span> }, []);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock analyzerCreate
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerByName
<div class="example-container" id="analyzerByName_container">
<a class="anchorjs-link " href="#analyzerByName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerByName_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>);
[ArangoAnalyzer <span class="hljs-string">"text_en"</span> (type text)]
</pre>
</div>
</div>
@endDocuBlock analyzerByName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerList
<div class="example-container" id="analyzerList_container">
<a class="anchorjs-link " href="#analyzerList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerList_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.toArray();
[
[ArangoAnalyzer <span class="hljs-string">"text_zh"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_sv"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_ru"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_pt"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_it"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_no"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_nl"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_de"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"identity"</span> (type identity)],
[ArangoAnalyzer <span class="hljs-string">"text_en"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_fi"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_es"</span> (type text)],
[ArangoAnalyzer <span class="hljs-string">"text_fr"</span> (type text)]
]
</pre>
<div id="analyzerList_container_collapse" onclick="$('#analyzerList_long').hide(); $('#analyzerList_short').show(); window.location.hash='analyzerList_container';" class="example_show_button">Hide execution results</div></div>
<div id="analyzerList_short" onclick="$('#analyzerList_short').hide(); $('#analyzerList_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock analyzerList
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerRemove
<div class="example-container" id="analyzerRemove_container">
<a class="anchorjs-link " href="#analyzerRemove_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerRemove_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.remove(<span class="hljs-string">"csv"</span>);
</pre>
</div>
</div>
@endDocuBlock analyzerRemove
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerName
<div class="example-container" id="analyzerName_container">
<a class="anchorjs-link " href="#analyzerName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerName_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>).name();
text_en
</pre>
</div>
</div>
@endDocuBlock analyzerName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerType
<div class="example-container" id="analyzerType_container">
<a class="anchorjs-link " href="#analyzerType_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerType_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>).type();
text
</pre>
</div>
</div>
@endDocuBlock analyzerType
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerProperties
<div class="example-container" id="analyzerProperties_container">
<a class="anchorjs-link " href="#analyzerProperties_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerProperties_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>).properties();
{
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"en.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="analyzerProperties_container_collapse" onclick="$('#analyzerProperties_long').hide(); $('#analyzerProperties_short').show(); window.location.hash='analyzerProperties_container';" class="example_show_button">Hide execution results</div></div>
<div id="analyzerProperties_short" onclick="$('#analyzerProperties_short').hide(); $('#analyzerProperties_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>).properties();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock analyzerProperties
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-analyzers.md -->
@startDocuBlockInline analyzerFeatures
<div class="example-container" id="analyzerFeatures_container">
<a class="anchorjs-link " href="#analyzerFeatures_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="analyzerFeatures_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>).features();
[
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
</pre>
<div id="analyzerFeatures_container_collapse" onclick="$('#analyzerFeatures_long').hide(); $('#analyzerFeatures_short').show(); window.location.hash='analyzerFeatures_container';" class="example_show_button">Hide execution results</div></div>
<div id="analyzerFeatures_short" onclick="$('#analyzerFeatures_short').hide(); $('#analyzerFeatures_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> analyzers = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/analyzers"</span>);
arangosh&gt; analyzers.analyzer(<span class="hljs-string">"text_en"</span>).features();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock analyzerFeatures
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-view-methods.md -->
@startDocuBlockInline viewDrop
<div class="example-container" id="viewDrop_container">
<a class="anchorjs-link " href="#viewDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewDrop_long">
<pre>
arangosh&gt; v = db._createView(<span class="hljs-string">"example"</span>, <span class="hljs-string">"arangosearch"</span>);
........&gt; <span class="hljs-comment">// or</span>
[ArangoView <span class="hljs-number">88713</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
arangosh&gt; v = db._view(<span class="hljs-string">"example"</span>);
[ArangoView <span class="hljs-number">88713</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
arangosh&gt; v.drop();
arangosh&gt; db._view(<span class="hljs-string">"example"</span>);
<span class="hljs-literal">null</span>
</pre>
</div>
</div>
@endDocuBlock viewDrop
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-view-methods.md -->
@startDocuBlockInline viewName
<div class="example-container" id="viewName_container">
<a class="anchorjs-link " href="#viewName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewName_long">
<pre>
arangosh&gt; v = db._view(<span class="hljs-string">"demoView"</span>);
[ArangoView <span class="hljs-number">112</span>, <span class="hljs-string">"demoView"</span> (type arangosearch)]
arangosh&gt; v.name();
demoView
</pre>
</div>
</div>
@endDocuBlock viewName
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-view-methods.md -->
@startDocuBlockInline viewRename
<div class="example-container" id="viewRename_container">
<a class="anchorjs-link " href="#viewRename_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewRename_long">
<pre>
arangosh&gt; v = db._createView(<span class="hljs-string">"example"</span>, <span class="hljs-string">"arangosearch"</span>);
[ArangoView <span class="hljs-number">88735</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
arangosh&gt; v.name();
example
arangosh&gt; v.rename(<span class="hljs-string">"exampleRenamed"</span>);
arangosh&gt; v.name();
exampleRenamed
</pre>
</div>
</div>
@endDocuBlock viewRename
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-view-methods.md -->
@startDocuBlockInline viewType
<div class="example-container" id="viewType_container">
<a class="anchorjs-link " href="#viewType_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewType_long">
<pre>
arangosh&gt; v = db._view(<span class="hljs-string">"demoView"</span>);
[ArangoView <span class="hljs-number">112</span>, <span class="hljs-string">"demoView"</span> (type arangosearch)]
arangosh&gt; v.type();
arangosearch
</pre>
</div>
</div>
@endDocuBlock viewType
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-view-methods.md -->
@startDocuBlockInline viewGetProperties
<div class="example-container" id="viewGetProperties_container">
<a class="anchorjs-link " href="#viewGetProperties_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewGetProperties_long" style="Display: none;">
<pre>
arangosh&gt; v = db._view(<span class="hljs-string">"demoView"</span>);
[ArangoView <span class="hljs-number">112</span>, <span class="hljs-string">"demoView"</span> (type arangosearch)]
arangosh&gt; v.properties();
{
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"links"</span> : {
},
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>
}
</pre>
<div id="viewGetProperties_container_collapse" onclick="$('#viewGetProperties_long').hide(); $('#viewGetProperties_short').show(); window.location.hash='viewGetProperties_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewGetProperties_short" onclick="$('#viewGetProperties_short').hide(); $('#viewGetProperties_long').show();">
<pre>
arangosh&gt; v = db._view(<span class="hljs-string">"demoView"</span>);
arangosh&gt; v.properties();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewGetProperties
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/data-modeling-views-view-methods.md -->
@startDocuBlockInline viewModifyProperties
<div class="example-container" id="viewModifyProperties_container">
<a class="anchorjs-link " href="#viewModifyProperties_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="viewModifyProperties_long" style="Display: none;">
<pre>
arangosh&gt; v = db._view(<span class="hljs-string">"example"</span>);
[ArangoView <span class="hljs-number">88719</span>, <span class="hljs-string">"example"</span> (type arangosearch)]
arangosh&gt; v.properties();
........&gt; <span class="hljs-comment">// set cleanupIntervalStep to 12</span>
{
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"links"</span> : {
},
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>
}
arangosh&gt; v.properties({<span class="hljs-attr">cleanupIntervalStep</span>: <span class="hljs-number">12</span>});
........&gt; <span class="hljs-comment">// add a link</span>
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
arangosh&gt; v.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">demo</span>: {}}})
........&gt; <span class="hljs-comment">// remove a link</span>
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
<span class="hljs-string">"demo"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"identity"</span>
],
<span class="hljs-string">"fields"</span> : {
},
<span class="hljs-string">"includeAllFields"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"storeValues"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"trackListPositions"</span> : <span class="hljs-literal">false</span>
}
}
}
arangosh&gt; v.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">demo</span>: <span class="hljs-literal">null</span>}})
{
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
</pre>
<div id="viewModifyProperties_container_collapse" onclick="$('#viewModifyProperties_long').hide(); $('#viewModifyProperties_short').show(); window.location.hash='viewModifyProperties_container';" class="example_show_button">Hide execution results</div></div>
<div id="viewModifyProperties_short" onclick="$('#viewModifyProperties_short').hide(); $('#viewModifyProperties_long').show();">
<pre>
arangosh&gt; v = db._view(<span class="hljs-string">"example"</span>);
arangosh&gt; v.properties();
........&gt; <span class="hljs-comment">// set cleanupIntervalStep to 12</span>
arangosh&gt; v.properties({<span class="hljs-attr">cleanupIntervalStep</span>: <span class="hljs-number">12</span>});
........&gt; <span class="hljs-comment">// add a link</span>
arangosh&gt; v.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">demo</span>: {}}})
........&gt; <span class="hljs-comment">// remove a link</span>
arangosh&gt; v.properties({<span class="hljs-attr">links</span>: {<span class="hljs-attr">demo</span>: <span class="hljs-literal">null</span>}})
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock viewModifyProperties
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-queries.md -->
@startDocuBlockInline QUERY_01_properyOfQueries
<div class="example-container" id="QUERY_01_properyOfQueries_container">
<a class="anchorjs-link " href="#QUERY_01_properyOfQueries_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="QUERY_01_properyOfQueries_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> queries = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/queries"</span>);
arangosh&gt; queries.properties();
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"enabled"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"trackSlowQueries"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"trackBindVars"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxSlowQueries"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"slowQueryThreshold"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"slowStreamingQueryThreshold"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"maxQueryStringLength"</span> : <span class="hljs-number">4096</span>
}
arangosh&gt; queries.properties({<span class="hljs-attr">slowQueryThreshold</span>: <span class="hljs-number">1</span>});
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"enabled"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"trackSlowQueries"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"trackBindVars"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxSlowQueries"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"slowQueryThreshold"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"slowStreamingQueryThreshold"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"maxQueryStringLength"</span> : <span class="hljs-number">4096</span>
}
arangosh&gt; queries.properties({<span class="hljs-attr">slowStreamingQueryThreshold</span>: <span class="hljs-number">1</span>});
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"enabled"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"trackSlowQueries"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"trackBindVars"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxSlowQueries"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"slowQueryThreshold"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"slowStreamingQueryThreshold"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"maxQueryStringLength"</span> : <span class="hljs-number">4096</span>
}
</pre>
<div id="QUERY_01_properyOfQueries_container_collapse" onclick="$('#QUERY_01_properyOfQueries_long').hide(); $('#QUERY_01_properyOfQueries_short').show(); window.location.hash='QUERY_01_properyOfQueries_container';" class="example_show_button">Hide execution results</div></div>
<div id="QUERY_01_properyOfQueries_short" onclick="$('#QUERY_01_properyOfQueries_short').hide(); $('#QUERY_01_properyOfQueries_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> queries = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/queries"</span>);
arangosh&gt; queries.properties();
arangosh&gt; queries.properties({<span class="hljs-attr">slowQueryThreshold</span>: <span class="hljs-number">1</span>});
arangosh&gt; queries.properties({<span class="hljs-attr">slowStreamingQueryThreshold</span>: <span class="hljs-number">1</span>});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock QUERY_01_properyOfQueries
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-queries.md -->
@startDocuBlockInline QUERY_02_listQueries
<div class="example-container" id="QUERY_02_listQueries_container">
<a class="anchorjs-link " href="#QUERY_02_listQueries_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="QUERY_02_listQueries_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> theQuery = <span class="hljs-string">'FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong'</span>;
arangosh&gt; <span class="hljs-keyword">var</span> tasks = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/tasks"</span>);
arangosh&gt; tasks.register({
........&gt; id: <span class="hljs-string">"mytask-1"</span>,
........&gt; name: <span class="hljs-string">"this is a sample task to spawn a slow aql query"</span>,
........&gt; command: <span class="hljs-string">"require('@arangodb').db._query('"</span> + theQuery + <span class="hljs-string">"');"</span>
........&gt; });
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"mytask-1"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"this is a sample task to spawn a slow aql query"</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1570112260.6496224</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"timed"</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function (params) { require('@arangodb').db._query('FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong'); } )(params);"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
arangosh&gt; queries.current();
[
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"383"</span>,
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong"</span>,
<span class="hljs-string">"bindVars"</span> : {
},
<span class="hljs-string">"started"</span> : <span class="hljs-string">"2019-10-03T14:17:40Z"</span>,
<span class="hljs-string">"runTime"</span> : <span class="hljs-number">1.0247559547424316</span>,
<span class="hljs-string">"state"</span> : <span class="hljs-string">"executing"</span>,
<span class="hljs-string">"stream"</span> : <span class="hljs-literal">false</span>
}
]
</pre>
<div id="QUERY_02_listQueries_container_collapse" onclick="$('#QUERY_02_listQueries_long').hide(); $('#QUERY_02_listQueries_short').show(); window.location.hash='QUERY_02_listQueries_container';" class="example_show_button">Hide execution results</div></div>
<div id="QUERY_02_listQueries_short" onclick="$('#QUERY_02_listQueries_short').hide(); $('#QUERY_02_listQueries_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> theQuery = <span class="hljs-string">'FOR sleepLoooong IN 1..5 LET sleepLoooonger = SLEEP(1000) RETURN sleepLoooong'</span>;
arangosh&gt; <span class="hljs-keyword">var</span> tasks = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/tasks"</span>);
arangosh&gt; tasks.register({
........&gt; id: <span class="hljs-string">"mytask-1"</span>,
........&gt; name: <span class="hljs-string">"this is a sample task to spawn a slow aql query"</span>,
........&gt; command: <span class="hljs-string">"require('@arangodb').db._query('"</span> + theQuery + <span class="hljs-string">"');"</span>
........&gt; });
arangosh&gt; queries.current();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock QUERY_02_listQueries
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-queries.md -->
@startDocuBlockInline QUERY_03_listSlowQueries
<div class="example-container" id="QUERY_03_listSlowQueries_container">
<a class="anchorjs-link " href="#QUERY_03_listSlowQueries_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="QUERY_03_listSlowQueries_long">
<pre>
arangosh&gt; queries.slow();
[ ]
</pre>
</div>
</div>
@endDocuBlock QUERY_03_listSlowQueries
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-queries.md -->
@startDocuBlockInline QUERY_04_clearSlowQueries
<div class="example-container" id="QUERY_04_clearSlowQueries_container">
<a class="anchorjs-link " href="#QUERY_04_clearSlowQueries_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="QUERY_04_clearSlowQueries_long">
<pre>
arangosh&gt; queries.clearSlow();
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
arangosh&gt; queries.slow();
[ ]
</pre>
</div>
</div>
@endDocuBlock QUERY_04_clearSlowQueries
<!-- filename: /work/ArangoDB/Documentation/Books/Manual/appendix-java-script-modules-queries.md -->
@startDocuBlockInline QUERY_05_killQueries
<div class="example-container" id="QUERY_05_killQueries_container">
<a class="anchorjs-link " href="#QUERY_05_killQueries_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="QUERY_05_killQueries_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> runningQueries = queries.current().filter(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">query</span>) </span>{
........&gt; <span class="hljs-keyword">return</span> query.query === theQuery;
........&gt; });
arangosh&gt; queries.kill(runningQueries[<span class="hljs-number">0</span>].id);
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
</div>
</div>
@endDocuBlock QUERY_05_killQueries
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 01_workWithAQL_databaseExplain
<div class="example-container" id="01_workWithAQL_databaseExplain_container">
<a class="anchorjs-link " href="#01_workWithAQL_databaseExplain_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="01_workWithAQL_databaseExplain_long" style="Display: none;">
<pre>
arangosh&gt; db._explain("LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1", {}, {colors: false});
Query String (47 chars, cacheable: false):
LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
4 CalculationNode 1 - LET #2 = 1 /* json expression */ /* const assignment */
2 CalculationNode 1 - LET s = SLEEP(0.25) /* simple expression */
3 CalculationNode 1 - LET t = SLEEP(0.5) /* simple expression */
5 ReturnNode 1 - RETURN #2
Indexes used:
none
Functions used:
Name Deterministic Cacheable Uses V8
SLEEP false false false
Optimization rules applied:
Id RuleName
1 move-calculations-up
</pre>
<div id="01_workWithAQL_databaseExplain_container_collapse" onclick="$('#01_workWithAQL_databaseExplain_long').hide(); $('#01_workWithAQL_databaseExplain_short').show(); window.location.hash='01_workWithAQL_databaseExplain_container';" class="example_show_button">Hide execution results</div></div>
<div id="01_workWithAQL_databaseExplain_short" onclick="$('#01_workWithAQL_databaseExplain_short').hide(); $('#01_workWithAQL_databaseExplain_long').show();">
<pre>
arangosh&gt; db._explain("LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1", {}, {colors: false});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 01_workWithAQL_databaseExplain
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 01_workWithAQL_databaseProfileQuery
<div class="example-container" id="01_workWithAQL_databaseProfileQuery_container">
<a class="anchorjs-link " href="#01_workWithAQL_databaseProfileQuery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="01_workWithAQL_databaseProfileQuery_long" style="Display: none;">
<pre>
arangosh&gt; db._profileQuery("LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1", {}, {colors: false});
Query String (47 chars, cacheable: false):
LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1
Execution plan:
Id NodeType Calls Items Runtime [s] Comment
1 SingletonNode 1 1 0.00000 * ROOT
4 CalculationNode 1 1 0.00000 - LET #2 = 1 /* json expression */ /* const assignment */
2 CalculationNode 1 1 0.27105 - LET s = SLEEP(0.25) /* simple expression */
3 CalculationNode 1 1 0.51186 - LET t = SLEEP(0.5) /* simple expression */
5 ReturnNode 1 1 0.00000 - RETURN #2
Indexes used:
none
Optimization rules applied:
Id RuleName
1 move-calculations-up
Query Statistics:
Writes Exec Writes Ign Scan Full Scan Index Filtered Exec Time [s]
0 0 0 0 0 0.78316
Query Profile:
Query Stage Duration [s]
initializing 0.00000
parsing 0.00003
optimizing ast 0.00001
loading collections 0.00002
instantiating plan 0.00001
optimizing plan 0.00007
executing 0.78294
finalizing 0.00008
</pre>
<div id="01_workWithAQL_databaseProfileQuery_container_collapse" onclick="$('#01_workWithAQL_databaseProfileQuery_long').hide(); $('#01_workWithAQL_databaseProfileQuery_short').show(); window.location.hash='01_workWithAQL_databaseProfileQuery_container';" class="example_show_button">Hide execution results</div></div>
<div id="01_workWithAQL_databaseProfileQuery_short" onclick="$('#01_workWithAQL_databaseProfileQuery_short').hide(); $('#01_workWithAQL_databaseProfileQuery_long').show();">
<pre>
arangosh&gt; db._profileQuery("LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1", {}, {colors: false});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 01_workWithAQL_databaseProfileQuery
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 07_workWithAQL_statementsExplain
<div class="example-container" id="07_workWithAQL_statementsExplain_container">
<a class="anchorjs-link " href="#07_workWithAQL_statementsExplain_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="07_workWithAQL_statementsExplain_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">"FOR user IN _users RETURN user"</span>);
arangosh&gt; stmt.explain();
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateCollectionNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"random"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexHint"</span> : {
<span class="hljs-string">"forced"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [ ],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="07_workWithAQL_statementsExplain_container_collapse" onclick="$('#07_workWithAQL_statementsExplain_long').hide(); $('#07_workWithAQL_statementsExplain_short').show(); window.location.hash='07_workWithAQL_statementsExplain_container';" class="example_show_button">Hide execution results</div></div>
<div id="07_workWithAQL_statementsExplain_short" onclick="$('#07_workWithAQL_statementsExplain_short').hide(); $('#07_workWithAQL_statementsExplain_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">"FOR user IN _users RETURN user"</span>);
arangosh&gt; stmt.explain();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 07_workWithAQL_statementsExplain
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 08_workWithAQL_statementsPlans
<div class="example-container" id="08_workWithAQL_statementsPlans_container">
<a class="anchorjs-link " href="#08_workWithAQL_statementsPlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="08_workWithAQL_statementsPlans_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> formatPlan = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">plan</span>) </span>{
........&gt; <span class="hljs-keyword">return</span> { <span class="hljs-attr">estimatedCost</span>: plan.estimatedCost,
........&gt; nodes: plan.nodes.map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">node</span>) </span>{
........&gt; <span class="hljs-keyword">return</span> node.type; }) }; };
arangosh&gt; formatPlan(stmt.explain().plan);
{
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"nodes"</span> : [
<span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"EnumerateCollectionNode"</span>,
<span class="hljs-string">"ReturnNode"</span>
]
}
</pre>
<div id="08_workWithAQL_statementsPlans_container_collapse" onclick="$('#08_workWithAQL_statementsPlans_long').hide(); $('#08_workWithAQL_statementsPlans_short').show(); window.location.hash='08_workWithAQL_statementsPlans_container';" class="example_show_button">Hide execution results</div></div>
<div id="08_workWithAQL_statementsPlans_short" onclick="$('#08_workWithAQL_statementsPlans_short').hide(); $('#08_workWithAQL_statementsPlans_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> formatPlan = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">plan</span>) </span>{
........&gt; <span class="hljs-keyword">return</span> { <span class="hljs-attr">estimatedCost</span>: plan.estimatedCost,
........&gt; nodes: plan.nodes.map(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">node</span>) </span>{
........&gt; <span class="hljs-keyword">return</span> node.type; }) }; };
arangosh&gt; formatPlan(stmt.explain().plan);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 08_workWithAQL_statementsPlans
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 09_workWithAQL_statementsPlansBind
<div class="example-container" id="09_workWithAQL_statementsPlansBind_container">
<a class="anchorjs-link " href="#09_workWithAQL_statementsPlansBind_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="09_workWithAQL_statementsPlansBind_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">`FOR doc IN @@collection FILTER doc.user == @user RETURN doc`</span>
........&gt; );
arangosh&gt; stmt.bind({ <span class="hljs-string">"@collection"</span> : <span class="hljs-string">"_users"</span>, <span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span> });
arangosh&gt; stmt.explain();
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">2.04475</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"46"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382023744421888"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"string"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">4</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3.04475</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3.04475</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="09_workWithAQL_statementsPlansBind_container_collapse" onclick="$('#09_workWithAQL_statementsPlansBind_long').hide(); $('#09_workWithAQL_statementsPlansBind_short').show(); window.location.hash='09_workWithAQL_statementsPlansBind_container';" class="example_show_button">Hide execution results</div></div>
<div id="09_workWithAQL_statementsPlansBind_short" onclick="$('#09_workWithAQL_statementsPlansBind_short').hide(); $('#09_workWithAQL_statementsPlansBind_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">`FOR doc IN @@collection FILTER doc.user == @user RETURN doc`</span>
........&gt; );
arangosh&gt; stmt.bind({ <span class="hljs-string">"@collection"</span> : <span class="hljs-string">"_users"</span>, <span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span> });
arangosh&gt; stmt.explain();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 09_workWithAQL_statementsPlansBind
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_statementsPlansOptimizer0
<div class="example-container" id="10_workWithAQL_statementsPlansOptimizer0_container">
<a class="anchorjs-link " href="#10_workWithAQL_statementsPlansOptimizer0_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_statementsPlansOptimizer0_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">"FOR user IN _users FILTER user.user == 'root' RETURN user"</span>);
arangosh&gt; stmt.explain({ <span class="hljs-attr">allPlans</span>: <span class="hljs-literal">true</span> }).plans.length;
<span class="hljs-number">1</span>
</pre>
</div>
</div>
@endDocuBlock 10_workWithAQL_statementsPlansOptimizer0
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_statementsPlansOptimizer1
<div class="example-container" id="10_workWithAQL_statementsPlansOptimizer1_container">
<a class="anchorjs-link " href="#10_workWithAQL_statementsPlansOptimizer1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_statementsPlansOptimizer1_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">allPlans</span>: <span class="hljs-literal">true</span> }).plans.map(
........&gt; <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">plan</span>) </span>{ <span class="hljs-keyword">return</span> formatPlan(plan); });
[
{
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3.04475</span>,
<span class="hljs-string">"nodes"</span> : [
<span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"ReturnNode"</span>
]
}
]
</pre>
<div id="10_workWithAQL_statementsPlansOptimizer1_container_collapse" onclick="$('#10_workWithAQL_statementsPlansOptimizer1_long').hide(); $('#10_workWithAQL_statementsPlansOptimizer1_short').show(); window.location.hash='10_workWithAQL_statementsPlansOptimizer1_container';" class="example_show_button">Hide execution results</div></div>
<div id="10_workWithAQL_statementsPlansOptimizer1_short" onclick="$('#10_workWithAQL_statementsPlansOptimizer1_short').hide(); $('#10_workWithAQL_statementsPlansOptimizer1_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">allPlans</span>: <span class="hljs-literal">true</span> }).plans.map(
........&gt; <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">plan</span>) </span>{ <span class="hljs-keyword">return</span> formatPlan(plan); });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 10_workWithAQL_statementsPlansOptimizer1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_statementsPlansOptimizer2
<div class="example-container" id="10_workWithAQL_statementsPlansOptimizer2_container">
<a class="anchorjs-link " href="#10_workWithAQL_statementsPlansOptimizer2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_statementsPlansOptimizer2_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: {
........&gt; rules: [ <span class="hljs-string">"-all"</span>, <span class="hljs-string">"+remove-redundant-calculations"</span> ] } });
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateCollectionNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"random"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexHint"</span> : {
<span class="hljs-string">"forced"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"string"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">4</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"FilterNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [ ],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">33</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="10_workWithAQL_statementsPlansOptimizer2_container_collapse" onclick="$('#10_workWithAQL_statementsPlansOptimizer2_long').hide(); $('#10_workWithAQL_statementsPlansOptimizer2_short').show(); window.location.hash='10_workWithAQL_statementsPlansOptimizer2_container';" class="example_show_button">Hide execution results</div></div>
<div id="10_workWithAQL_statementsPlansOptimizer2_short" onclick="$('#10_workWithAQL_statementsPlansOptimizer2_short').hide(); $('#10_workWithAQL_statementsPlansOptimizer2_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: {
........&gt; rules: [ <span class="hljs-string">"-all"</span>, <span class="hljs-string">"+remove-redundant-calculations"</span> ] } });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 10_workWithAQL_statementsPlansOptimizer2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_statementsPlansOptimizer3
<div class="example-container" id="10_workWithAQL_statementsPlansOptimizer3_container">
<a class="anchorjs-link " href="#10_workWithAQL_statementsPlansOptimizer3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_statementsPlansOptimizer3_long" style="Display: none;">
<pre>
arangosh&gt; var query = "FOR doc IN mycollection FILTER doc.value &gt; 42 RETURN doc";
arangosh&gt; require("@arangodb/aql/explainer").explain(query, {colors:false});
Query String (56 chars, cacheable: true):
FOR doc IN mycollection FILTER doc.value &gt; 42 RETURN doc
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
2 EnumerateCollectionNode 302 - FOR doc IN mycollection /* full collection scan */
3 CalculationNode 302 - LET #1 = (doc.`value` &gt; 42) /* simple expression */ /* collections used: doc : mycollection */
4 FilterNode 302 - FILTER #1
5 ReturnNode 302 - RETURN doc
Indexes used:
none
Optimization rules applied:
none
</pre>
<div id="10_workWithAQL_statementsPlansOptimizer3_container_collapse" onclick="$('#10_workWithAQL_statementsPlansOptimizer3_long').hide(); $('#10_workWithAQL_statementsPlansOptimizer3_short').show(); window.location.hash='10_workWithAQL_statementsPlansOptimizer3_container';" class="example_show_button">Hide execution results</div></div>
<div id="10_workWithAQL_statementsPlansOptimizer3_short" onclick="$('#10_workWithAQL_statementsPlansOptimizer3_short').hide(); $('#10_workWithAQL_statementsPlansOptimizer3_long').show();">
<pre>
arangosh&gt; var query = "FOR doc IN mycollection FILTER doc.value &gt; 42 RETURN doc";
arangosh&gt; require("@arangodb/aql/explainer").explain(query, {colors:false});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 10_workWithAQL_statementsPlansOptimizer3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_debugging1
<div class="example-container" id="10_workWithAQL_debugging1_container">
<a class="anchorjs-link " href="#10_workWithAQL_debugging1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_debugging1_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc IN mycollection FILTER doc.value &gt; 42 RETURN doc"</span>;
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/explainer"</span>).debugDump(<span class="hljs-string">"/tmp/query-debug-info"</span>, query);
</pre>
</div>
</div>
@endDocuBlock 10_workWithAQL_debugging1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_debugging2
<div class="example-container" id="10_workWithAQL_debugging2_container">
<a class="anchorjs-link " href="#10_workWithAQL_debugging2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_debugging2_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc IN @@collection FILTER doc.value &gt; @value RETURN doc"</span>;
arangosh&gt; <span class="hljs-keyword">var</span> bind = { <span class="hljs-attr">value</span>: <span class="hljs-number">42</span>, <span class="hljs-string">"@collection"</span>: <span class="hljs-string">"mycollection"</span> };
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/explainer"</span>).debugDump(<span class="hljs-string">"/tmp/query-debug-info"</span>, query, bind);
</pre>
</div>
</div>
@endDocuBlock 10_workWithAQL_debugging2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-explaining-queries.md -->
@startDocuBlockInline 10_workWithAQL_debugging3
<div class="example-container" id="10_workWithAQL_debugging3_container">
<a class="anchorjs-link " href="#10_workWithAQL_debugging3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="10_workWithAQL_debugging3_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> query = <span class="hljs-string">"FOR doc IN @@collection FILTER doc.value &gt; @value RETURN doc"</span>;
arangosh&gt; <span class="hljs-keyword">var</span> bind = { <span class="hljs-attr">value</span>: <span class="hljs-number">42</span>, <span class="hljs-string">"@collection"</span>: <span class="hljs-string">"mycollection"</span> };
arangosh&gt; <span class="hljs-keyword">var</span> options = { <span class="hljs-attr">examples</span>: <span class="hljs-number">10</span>, <span class="hljs-attr">anonymize</span>: <span class="hljs-literal">true</span> };
arangosh&gt; <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/aql/explainer"</span>).debugDump(<span class="hljs-string">"/tmp/query-debug-info"</span>, query, bind, options);
</pre>
</div>
</div>
@endDocuBlock 10_workWithAQL_debugging3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphPruneEdges
<div class="example-container" id="GRAPHTRAV_graphPruneEdges_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphPruneEdges_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphPruneEdges_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
PRUNE e.theTruth == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphPruneEdges_container_collapse" onclick="$('#GRAPHTRAV_graphPruneEdges_long').hide(); $('#GRAPHTRAV_graphPruneEdges_short').show(); window.location.hash='GRAPHTRAV_graphPruneEdges_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphPruneEdges_short" onclick="$('#GRAPHTRAV_graphPruneEdges_short').hide(); $('#GRAPHTRAV_graphPruneEdges_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
PRUNE e.theTruth == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphPruneEdges
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphPruneVertices
<div class="example-container" id="GRAPHTRAV_graphPruneVertices_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphPruneVertices_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphPruneVertices_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
PRUNE v._key == <span class="hljs-string">'G'</span>
FILTER v._key == <span class="hljs-string">'G'</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphPruneVertices_container_collapse" onclick="$('#GRAPHTRAV_graphPruneVertices_long').hide(); $('#GRAPHTRAV_graphPruneVertices_short').show(); window.location.hash='GRAPHTRAV_graphPruneVertices_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphPruneVertices_short" onclick="$('#GRAPHTRAV_graphPruneVertices_short').hide(); $('#GRAPHTRAV_graphPruneVertices_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
PRUNE v._key == <span class="hljs-string">'G'</span>
FILTER v._key == <span class="hljs-string">'G'</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphPruneVertices
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphPruneCollection
<div class="example-container" id="GRAPHTRAV_graphPruneCollection_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphPruneCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphPruneCollection_long">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
PRUNE IS_SAME_COLLECTION(<span class="hljs-string">'circles'</span>, v)
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphPruneCollection
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphFilterEdges
<div class="example-container" id="GRAPHTRAV_graphFilterEdges_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphFilterEdges_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphFilterEdges_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].theTruth == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blarg"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blarg"</span>,
<span class="hljs-string">"left_blorg"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"E"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blub"</span>,
<span class="hljs-string">"left_schubi"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>,
<span class="hljs-string">"right_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>,
<span class="hljs-string">"right_zup"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphFilterEdges_container_collapse" onclick="$('#GRAPHTRAV_graphFilterEdges_long').hide(); $('#GRAPHTRAV_graphFilterEdges_short').show(); window.location.hash='GRAPHTRAV_graphFilterEdges_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphFilterEdges_short" onclick="$('#GRAPHTRAV_graphFilterEdges_short').hide(); $('#GRAPHTRAV_graphFilterEdges_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].theTruth == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphFilterEdges
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphFilterVertices
<div class="example-container" id="GRAPHTRAV_graphFilterVertices_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphFilterVertices_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphFilterVertices_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key == <span class="hljs-string">"G"</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>,
<span class="hljs-string">"right_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>,
<span class="hljs-string">"right_zup"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphFilterVertices_container_collapse" onclick="$('#GRAPHTRAV_graphFilterVertices_long').hide(); $('#GRAPHTRAV_graphFilterVertices_short').show(); window.location.hash='GRAPHTRAV_graphFilterVertices_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphFilterVertices_short" onclick="$('#GRAPHTRAV_graphFilterVertices_short').hide(); $('#GRAPHTRAV_graphFilterVertices_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key == <span class="hljs-string">"G"</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphFilterVertices
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphFilterCombine
<div class="example-container" id="GRAPHTRAV_graphFilterCombine_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphFilterCombine_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphFilterCombine_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].theTruth == <span class="hljs-literal">true</span>
AND p.edges[<span class="hljs-number">1</span>].theFalse == <span class="hljs-literal">false</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key == <span class="hljs-string">"G"</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>,
<span class="hljs-string">"right_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>,
<span class="hljs-string">"right_zup"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphFilterCombine_container_collapse" onclick="$('#GRAPHTRAV_graphFilterCombine_long').hide(); $('#GRAPHTRAV_graphFilterCombine_short').show(); window.location.hash='GRAPHTRAV_graphFilterCombine_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphFilterCombine_short" onclick="$('#GRAPHTRAV_graphFilterCombine_short').hide(); $('#GRAPHTRAV_graphFilterCombine_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].theTruth == <span class="hljs-literal">true</span>
AND p.edges[<span class="hljs-number">1</span>].theFalse == <span class="hljs-literal">false</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key == <span class="hljs-string">"G"</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphFilterCombine
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphFilterEntirePath
<div class="example-container" id="GRAPHTRAV_graphFilterEntirePath_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphFilterEntirePath_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphFilterEntirePath_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[*].theTruth ALL == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blarg"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blarg"</span>,
<span class="hljs-string">"left_blorg"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"E"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blub"</span>,
<span class="hljs-string">"left_schubi"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>,
<span class="hljs-string">"right_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>,
<span class="hljs-string">"right_zup"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphFilterEntirePath_container_collapse" onclick="$('#GRAPHTRAV_graphFilterEntirePath_long').hide(); $('#GRAPHTRAV_graphFilterEntirePath_short').show(); window.location.hash='GRAPHTRAV_graphFilterEntirePath_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphFilterEntirePath_short" onclick="$('#GRAPHTRAV_graphFilterEntirePath_short').hide(); $('#GRAPHTRAV_graphFilterEntirePath_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[*].theTruth ALL == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphFilterEntirePath
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphFilterPathEdges
<div class="example-container" id="GRAPHTRAV_graphFilterPathEdges_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphFilterPathEdges_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphFilterPathEdges_long">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[*].theTruth NONE == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphFilterPathEdges
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_graphFilterPathAnyEdge
<div class="example-container" id="GRAPHTRAV_graphFilterPathAnyEdge_container">
<a class="anchorjs-link " href="#GRAPHTRAV_graphFilterPathAnyEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_graphFilterPathAnyEdge_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[*].theTruth ANY == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blarg"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blarg"</span>,
<span class="hljs-string">"left_blorg"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"E"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"left_bar"</span>,
<span class="hljs-string">"left_blub"</span>,
<span class="hljs-string">"left_schubi"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_blob"</span>,
<span class="hljs-string">"right_blub"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>
]
},
{
<span class="hljs-string">"vertices"</span>: [
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
],
<span class="hljs-string">"edges"</span>: [
<span class="hljs-string">"right_foo"</span>,
<span class="hljs-string">"right_zip"</span>,
<span class="hljs-string">"right_zup"</span>
]
}
]</pre>
<div id="GRAPHTRAV_graphFilterPathAnyEdge_container_collapse" onclick="$('#GRAPHTRAV_graphFilterPathAnyEdge_long').hide(); $('#GRAPHTRAV_graphFilterPathAnyEdge_short').show(); window.location.hash='GRAPHTRAV_graphFilterPathAnyEdge_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_graphFilterPathAnyEdge_short" onclick="$('#GRAPHTRAV_graphFilterPathAnyEdge_short').hide(); $('#GRAPHTRAV_graphFilterPathAnyEdge_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.5</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[*].theTruth ANY == <span class="hljs-literal">true</span>
RETURN { <span class="hljs-attr">vertices</span>: p.vertices[*]._key, <span class="hljs-attr">edges</span>: p.edges[*].label }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_graphFilterPathAnyEdge
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_01_create_graph
<div class="example-container" id="GRAPHTRAV_01_create_graph_container">
<a class="anchorjs-link " href="#GRAPHTRAV_01_create_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_01_create_graph_long" style="Display: none;">
<pre>
arangosh&gt; var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh&gt; var graph = examples.loadGraph("traversalGraph");
arangosh&gt; db.circles.toArray();
[
{
"_key" : "A",
"_id" : "circles/A",
"_rev" : "_ZXF5v5S---",
"label" : "1"
},
{
"_key" : "B",
"_id" : "circles/B",
"_rev" : "_ZXF5v5S--A",
"label" : "2"
},
{
"_key" : "C",
"_id" : "circles/C",
"_rev" : "_ZXF5v5W---",
"label" : "3"
},
{
"_key" : "D",
"_id" : "circles/D",
"_rev" : "_ZXF5v5W--A",
"label" : "4"
},
{
"_key" : "E",
"_id" : "circles/E",
"_rev" : "_ZXF5v5W--C",
"label" : "5"
},
{
"_key" : "F",
"_id" : "circles/F",
"_rev" : "_ZXF5v5W--E",
"label" : "6"
},
{
"_key" : "G",
"_id" : "circles/G",
"_rev" : "_ZXF5v5W--G",
"label" : "7"
},
{
"_key" : "H",
"_id" : "circles/H",
"_rev" : "_ZXF5v5a--_",
"label" : "8"
},
{
"_key" : "I",
"_id" : "circles/I",
"_rev" : "_ZXF5v5a--B",
"label" : "9"
},
{
"_key" : "J",
"_id" : "circles/J",
"_rev" : "_ZXF5v5a--D",
"label" : "10"
},
{
"_key" : "K",
"_id" : "circles/K",
"_rev" : "_ZXF5v5a--F",
"label" : "11"
}
]
arangosh&gt; db.edges.toArray();
[
{
"_key" : "66250",
"_id" : "edges/66250",
"_from" : "circles/A",
"_to" : "circles/B",
"_rev" : "_ZXF5v5e---",
"theFalse" : false,
"theTruth" : true,
"label" : "left_bar"
},
{
"_key" : "66252",
"_id" : "edges/66252",
"_from" : "circles/B",
"_to" : "circles/C",
"_rev" : "_ZXF5v5e--A",
"theFalse" : false,
"theTruth" : true,
"label" : "left_blarg"
},
{
"_key" : "66254",
"_id" : "edges/66254",
"_from" : "circles/C",
"_to" : "circles/D",
"_rev" : "_ZXF5v5e--C",
"theFalse" : false,
"theTruth" : true,
"label" : "left_blorg"
},
{
"_key" : "66256",
"_id" : "edges/66256",
"_from" : "circles/B",
"_to" : "circles/E",
"_rev" : "_ZXF5v5e--E",
"theFalse" : false,
"theTruth" : true,
"label" : "left_blub"
},
{
"_key" : "66258",
"_id" : "edges/66258",
"_from" : "circles/E",
"_to" : "circles/F",
"_rev" : "_ZXF5v5i---",
"theFalse" : false,
"theTruth" : true,
"label" : "left_schubi"
},
{
"_key" : "66260",
"_id" : "edges/66260",
"_from" : "circles/A",
"_to" : "circles/G",
"_rev" : "_ZXF5v5i--A",
"theFalse" : false,
"theTruth" : true,
"label" : "right_foo"
},
{
"_key" : "66262",
"_id" : "edges/66262",
"_from" : "circles/G",
"_to" : "circles/H",
"_rev" : "_ZXF5v5i--C",
"theFalse" : false,
"theTruth" : true,
"label" : "right_blob"
},
{
"_key" : "66264",
"_id" : "edges/66264",
"_from" : "circles/H",
"_to" : "circles/I",
"_rev" : "_ZXF5v5i--E",
"theFalse" : false,
"theTruth" : true,
"label" : "right_blub"
},
{
"_key" : "66266",
"_id" : "edges/66266",
"_from" : "circles/G",
"_to" : "circles/J",
"_rev" : "_ZXF5v5m---",
"theFalse" : false,
"theTruth" : true,
"label" : "right_zip"
},
{
"_key" : "66268",
"_id" : "edges/66268",
"_from" : "circles/J",
"_to" : "circles/K",
"_rev" : "_ZXF5v5m--A",
"theFalse" : false,
"theTruth" : true,
"label" : "right_zup"
}
]
arangosh&gt; print("once you don't need them anymore, clean them up:");
once you don't need them anymore, clean them up:
arangosh&gt; examples.dropGraph("traversalGraph");
</pre>
<div id="GRAPHTRAV_01_create_graph_container_collapse" onclick="$('#GRAPHTRAV_01_create_graph_long').hide(); $('#GRAPHTRAV_01_create_graph_short').show(); window.location.hash='GRAPHTRAV_01_create_graph_container';" class="example_show_button">Hide execution results</div></div>
<div id="GRAPHTRAV_01_create_graph_short" onclick="$('#GRAPHTRAV_01_create_graph_short').hide(); $('#GRAPHTRAV_01_create_graph_long').show();">
<pre>
arangosh&gt; var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh&gt; var graph = examples.loadGraph("traversalGraph");
arangosh&gt; db.circles.toArray();
arangosh&gt; db.edges.toArray();
arangosh&gt; print("once you don't need them anymore, clean them up:");
arangosh&gt; examples.dropGraph("traversalGraph");
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_01_create_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_02_traverse_all_a
<div class="example-container" id="GRAPHTRAV_02_traverse_all_a_container">
<a class="anchorjs-link " href="#GRAPHTRAV_02_traverse_all_a_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_02_traverse_all_a_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
]</pre>
<div id="GRAPHTRAV_02_traverse_all_a_container_collapse" onclick="$('#GRAPHTRAV_02_traverse_all_a_long').hide(); $('#GRAPHTRAV_02_traverse_all_a_short').show(); window.location.hash='GRAPHTRAV_02_traverse_all_a_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_02_traverse_all_a_short" onclick="$('#GRAPHTRAV_02_traverse_all_a_short').hide(); $('#GRAPHTRAV_02_traverse_all_a_long').show();">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_02_traverse_all_a
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_02_traverse_all_b
<div class="example-container" id="GRAPHTRAV_02_traverse_all_b_container">
<a class="anchorjs-link " href="#GRAPHTRAV_02_traverse_all_b_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_02_traverse_all_b_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> edges RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>,
<span class="hljs-string">"G"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"I"</span>,
<span class="hljs-string">"J"</span>,
<span class="hljs-string">"K"</span>
]</pre>
<div id="GRAPHTRAV_02_traverse_all_b_container_collapse" onclick="$('#GRAPHTRAV_02_traverse_all_b_long').hide(); $('#GRAPHTRAV_02_traverse_all_b_short').show(); window.location.hash='GRAPHTRAV_02_traverse_all_b_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_02_traverse_all_b_short" onclick="$('#GRAPHTRAV_02_traverse_all_b_short').hide(); $('#GRAPHTRAV_02_traverse_all_b_long').show();">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> edges RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_02_traverse_all_b
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_03_traverse_3a
<div class="example-container" id="GRAPHTRAV_03_traverse_3a_container">
<a class="anchorjs-link " href="#GRAPHTRAV_03_traverse_3a_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_03_traverse_3a_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">2.</span><span class="hljs-number">.2</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"J"</span>
]</pre>
<div id="GRAPHTRAV_03_traverse_3a_container_collapse" onclick="$('#GRAPHTRAV_03_traverse_3a_long').hide(); $('#GRAPHTRAV_03_traverse_3a_short').show(); window.location.hash='GRAPHTRAV_03_traverse_3a_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_03_traverse_3a_short" onclick="$('#GRAPHTRAV_03_traverse_3a_short').hide(); $('#GRAPHTRAV_03_traverse_3a_long').show();">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">2.</span><span class="hljs-number">.2</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_03_traverse_3a
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_03_traverse_3b
<div class="example-container" id="GRAPHTRAV_03_traverse_3b_container">
<a class="anchorjs-link " href="#GRAPHTRAV_03_traverse_3b_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_03_traverse_3b_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">2</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"H"</span>,
<span class="hljs-string">"J"</span>
]</pre>
<div id="GRAPHTRAV_03_traverse_3b_container_collapse" onclick="$('#GRAPHTRAV_03_traverse_3b_long').hide(); $('#GRAPHTRAV_03_traverse_3b_short').show(); window.location.hash='GRAPHTRAV_03_traverse_3b_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_03_traverse_3b_short" onclick="$('#GRAPHTRAV_03_traverse_3b_short').hide(); $('#GRAPHTRAV_03_traverse_3b_long').show();">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">2</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_03_traverse_3b
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_04_traverse_4a
<div class="example-container" id="GRAPHTRAV_04_traverse_4a_container">
<a class="anchorjs-link " href="#GRAPHTRAV_04_traverse_4a_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_04_traverse_4a_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key != <span class="hljs-string">'G'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>
]</pre>
<div id="GRAPHTRAV_04_traverse_4a_container_collapse" onclick="$('#GRAPHTRAV_04_traverse_4a_long').hide(); $('#GRAPHTRAV_04_traverse_4a_short').show(); window.location.hash='GRAPHTRAV_04_traverse_4a_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_04_traverse_4a_short" onclick="$('#GRAPHTRAV_04_traverse_4a_short').hide(); $('#GRAPHTRAV_04_traverse_4a_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key != <span class="hljs-string">'G'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_04_traverse_4a
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_04_traverse_4b
<div class="example-container" id="GRAPHTRAV_04_traverse_4b_container">
<a class="anchorjs-link " href="#GRAPHTRAV_04_traverse_4b_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_04_traverse_4b_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].label != <span class="hljs-string">'right_foo'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"E"</span>,
<span class="hljs-string">"F"</span>
]</pre>
<div id="GRAPHTRAV_04_traverse_4b_container_collapse" onclick="$('#GRAPHTRAV_04_traverse_4b_long').hide(); $('#GRAPHTRAV_04_traverse_4b_short').show(); window.location.hash='GRAPHTRAV_04_traverse_4b_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_04_traverse_4b_short" onclick="$('#GRAPHTRAV_04_traverse_4b_short').hide(); $('#GRAPHTRAV_04_traverse_4b_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].label != <span class="hljs-string">'right_foo'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_04_traverse_4b
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_05_traverse_5a
<div class="example-container" id="GRAPHTRAV_05_traverse_5a_container">
<a class="anchorjs-link " href="#GRAPHTRAV_05_traverse_5a_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_05_traverse_5a_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key != <span class="hljs-string">'G'</span>
FILTER p.edges[<span class="hljs-number">1</span>].label != <span class="hljs-string">'left_blub'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>
]</pre>
<div id="GRAPHTRAV_05_traverse_5a_container_collapse" onclick="$('#GRAPHTRAV_05_traverse_5a_long').hide(); $('#GRAPHTRAV_05_traverse_5a_short').show(); window.location.hash='GRAPHTRAV_05_traverse_5a_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_05_traverse_5a_short" onclick="$('#GRAPHTRAV_05_traverse_5a_short').hide(); $('#GRAPHTRAV_05_traverse_5a_long').show();">
<strong>Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key != <span class="hljs-string">'G'</span>
FILTER p.edges[<span class="hljs-number">1</span>].label != <span class="hljs-string">'left_blub'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_05_traverse_5a
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_05_traverse_5b
<div class="example-container" id="GRAPHTRAV_05_traverse_5b_container">
<a class="anchorjs-link " href="#GRAPHTRAV_05_traverse_5b_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_05_traverse_5b_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key != <span class="hljs-string">'G'</span> AND p.edges[<span class="hljs-number">1</span>].label != <span class="hljs-string">'left_blub'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>
]</pre>
<div id="GRAPHTRAV_05_traverse_5b_container_collapse" onclick="$('#GRAPHTRAV_05_traverse_5b_long').hide(); $('#GRAPHTRAV_05_traverse_5b_short').show(); window.location.hash='GRAPHTRAV_05_traverse_5b_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_05_traverse_5b_short" onclick="$('#GRAPHTRAV_05_traverse_5b_short').hide(); $('#GRAPHTRAV_05_traverse_5b_long').show();">
<strong>Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.vertices[<span class="hljs-number">1</span>]._key != <span class="hljs-string">'G'</span> AND p.edges[<span class="hljs-number">1</span>].label != <span class="hljs-string">'left_blub'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_05_traverse_5b
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_06_traverse_6a
<div class="example-container" id="GRAPHTRAV_06_traverse_6a_container">
<a class="anchorjs-link " href="#GRAPHTRAV_06_traverse_6a_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_06_traverse_6a_long">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/E'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"F"</span>
]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_06_traverse_6a
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_06_traverse_6b
<div class="example-container" id="GRAPHTRAV_06_traverse_6b_container">
<a class="anchorjs-link " href="#GRAPHTRAV_06_traverse_6b_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_06_traverse_6b_long">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> INBOUND <span class="hljs-string">'circles/E'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"A"</span>
]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_06_traverse_6b
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_06_traverse_6c
<div class="example-container" id="GRAPHTRAV_06_traverse_6c_container">
<a class="anchorjs-link " href="#GRAPHTRAV_06_traverse_6c_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_06_traverse_6c_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> ANY <span class="hljs-string">'circles/E'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"F"</span>,
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"A"</span>,
<span class="hljs-string">"G"</span>
]</pre>
<div id="GRAPHTRAV_06_traverse_6c_container_collapse" onclick="$('#GRAPHTRAV_06_traverse_6c_long').hide(); $('#GRAPHTRAV_06_traverse_6c_short').show(); window.location.hash='GRAPHTRAV_06_traverse_6c_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHTRAV_06_traverse_6c_short" onclick="$('#GRAPHTRAV_06_traverse_6c_short').hide(); $('#GRAPHTRAV_06_traverse_6c_long').show();">
<strong>Query:</strong>
<pre>
FOR v IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> ANY <span class="hljs-string">'circles/E'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
RETURN v._key
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_06_traverse_6c
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_07_traverse_7
<div class="example-container" id="GRAPHTRAV_07_traverse_7_container">
<a class="anchorjs-link " href="#GRAPHTRAV_07_traverse_7_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_07_traverse_7_long" style="Display: none;">
<strong>Explain Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
LET localScopeVar = RAND() &gt; <span class="hljs-number">0.5</span>
FILTER p.edges[<span class="hljs-number">0</span>].theTruth != localScopeVar
RETURN v._key
</pre>
<strong>Explain output:</strong>
<pre>
Query String (173 chars, cacheable: false):
FOR v,e,p IN 1..3 OUTBOUND 'circles/A' GRAPH 'traversalGraph'
LET localScopeVar = RAND() &gt; 0.5
FILTER p.edges[0].theTruth != localScopeVar
RETURN v._key
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
2 TraversalNode 1 - FOR v /* vertex */, p /* paths */ IN 1..3 /* min..maxPathDepth */ OUTBOUND 'circles/A' /* startnode */ GRAPH 'traversalGraph'
3 CalculationNode 1 - LET localScopeVar = (RAND() &gt; 0.5) /* simple expression */
4 CalculationNode 1 - LET #6 = (p.`edges`[0].`theTruth` != localScopeVar) /* simple expression */
5 FilterNode 1 - FILTER #6
6 CalculationNode 1 - LET #8 = v.`_key` /* attribute expression */
7 ReturnNode 1 - RETURN #8
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
2 edge edge edges false false 100.00 % [ `_from` ] base OUTBOUND
Functions used:
Name Deterministic Cacheable Uses V8
RAND false false false
Traversals on graphs:
Id Depth Vertex collections Edge collections Options Filter / Prune Conditions
2 1..3 circles edges uniqueVertices: none, uniqueEdges: path
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 optimize-traversals
3 move-calculations-down
</pre>
<div id="GRAPHTRAV_07_traverse_7_container_collapse" onclick="$('#GRAPHTRAV_07_traverse_7_long').hide(); $('#GRAPHTRAV_07_traverse_7_short').show(); window.location.hash='GRAPHTRAV_07_traverse_7_container';" class="example_show_button">Hide explain output</div></div>
<div id="GRAPHTRAV_07_traverse_7_short" onclick="$('#GRAPHTRAV_07_traverse_7_short').hide(); $('#GRAPHTRAV_07_traverse_7_long').show();">
<strong>Explain Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
LET localScopeVar = RAND() &gt; <span class="hljs-number">0.5</span>
FILTER p.edges[<span class="hljs-number">0</span>].theTruth != localScopeVar
RETURN v._key
</pre><div class="example_show_button">Show explain output</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_07_traverse_7
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_07_traverse_8
<div class="example-container" id="GRAPHTRAV_07_traverse_8_container">
<a class="anchorjs-link " href="#GRAPHTRAV_07_traverse_8_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_07_traverse_8_long" style="Display: none;">
<strong>Explain Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].label == <span class="hljs-string">'right_foo'</span>
RETURN v._key
</pre>
<strong>Explain output:</strong>
<pre>
Query String (129 chars, cacheable: true):
FOR v,e,p IN 1..3 OUTBOUND 'circles/A' GRAPH 'traversalGraph'
FILTER p.edges[0].label == 'right_foo'
RETURN v._key
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
2 TraversalNode 1 - FOR v /* vertex */ IN 1..3 /* min..maxPathDepth */ OUTBOUND 'circles/A' /* startnode */ GRAPH 'traversalGraph'
5 CalculationNode 1 - LET #7 = v.`_key` /* attribute expression */
6 ReturnNode 1 - RETURN #7
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
2 edge edge edges false false 100.00 % [ `_from` ] base OUTBOUND
2 edge edge edges false false 100.00 % [ `_from` ] level 0 OUTBOUND
Traversals on graphs:
Id Depth Vertex collections Edge collections Options Filter / Prune Conditions
2 1..3 circles edges uniqueVertices: none, uniqueEdges: path FILTER (p.`edges`[0].`label` == "right_foo")
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 move-filters-up
3 move-calculations-up-2
4 move-filters-up-2
5 optimize-traversals
6 remove-filter-covered-by-traversal
7 remove-unnecessary-calculations-2
8 remove-redundant-path-var
</pre>
<div id="GRAPHTRAV_07_traverse_8_container_collapse" onclick="$('#GRAPHTRAV_07_traverse_8_long').hide(); $('#GRAPHTRAV_07_traverse_8_short').show(); window.location.hash='GRAPHTRAV_07_traverse_8_container';" class="example_show_button">Hide explain output</div></div>
<div id="GRAPHTRAV_07_traverse_8_short" onclick="$('#GRAPHTRAV_07_traverse_8_short').hide(); $('#GRAPHTRAV_07_traverse_8_long').show();">
<strong>Explain Query:</strong>
<pre>
FOR v,e,p IN <span class="hljs-number">1.</span><span class="hljs-number">.3</span> OUTBOUND <span class="hljs-string">'circles/A'</span> GRAPH <span class="hljs-string">'traversalGraph'</span>
FILTER p.edges[<span class="hljs-number">0</span>].label == <span class="hljs-string">'right_foo'</span>
RETURN v._key
</pre><div class="example_show_button">Show explain output</div>
</div>
</div>
@endDocuBlock GRAPHTRAV_07_traverse_8
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-traversals.md -->
@startDocuBlockInline GRAPHTRAV_99_drop_graph
<div class="example-container" id="GRAPHTRAV_99_drop_graph_container">
<a class="anchorjs-link " href="#GRAPHTRAV_99_drop_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_99_drop_graph_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; examples.dropGraph(<span class="hljs-string">"traversalGraph"</span>);
</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_99_drop_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_01_axplainer
<div class="example-container" id="AQLEXP_01_axplainer_container">
<a class="anchorjs-link " href="#AQLEXP_01_axplainer_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_01_axplainer_long" style="Display: none;">
<pre>
arangosh&gt; db._create("test");
[ArangoCollection 64681, "test" (type document, status loaded)]
arangosh&gt; for (i = 0; i &lt; 100; ++i) { db.test.save({ value: i }); }
arangosh&gt; db.test.ensureIndex({ type: "skiplist", fields: [ "value" ] });
{
"deduplicate" : true,
"fields" : [
"value"
],
"id" : "test/64886",
"isNewlyCreated" : true,
"name" : "idx_1646382032803069956",
"selectivityEstimate" : 1,
"sparse" : false,
"type" : "skiplist",
"unique" : false,
"code" : 201
}
arangosh&gt; var explain = require("@arangodb/aql/explainer").explain;
arangosh&gt; explain("FOR i IN test FILTER i.value &gt; 97 SORT i.value RETURN i.value", {colors:false});
Query String (61 chars, cacheable: true):
FOR i IN test FILTER i.value &gt; 97 SORT i.value RETURN i.value
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
9 IndexNode 50 - FOR i IN test /* skiplist index scan, index only, projections: `value` */
5 CalculationNode 50 - LET #3 = i.`value` /* attribute expression */ /* collections used: i : test */
8 ReturnNode 50 - RETURN #3
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
9 idx_1646382032803069956 skiplist test false false 100.00 % [ `value` ] (i.`value` &gt; 97)
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 move-filters-up
3 remove-redundant-calculations
4 remove-unnecessary-calculations
5 move-calculations-up-2
6 move-filters-up-2
7 use-indexes
8 remove-filter-covered-by-index
9 use-index-for-sort
10 remove-unnecessary-calculations-2
11 reduce-extraction-to-projection
</pre>
<div id="AQLEXP_01_axplainer_container_collapse" onclick="$('#AQLEXP_01_axplainer_long').hide(); $('#AQLEXP_01_axplainer_short').show(); window.location.hash='AQLEXP_01_axplainer_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_01_axplainer_short" onclick="$('#AQLEXP_01_axplainer_short').hide(); $('#AQLEXP_01_axplainer_long').show();">
<pre>
arangosh&gt; db._create("test");
arangosh&gt; for (i = 0; i &lt; 100; ++i) { db.test.save({ value: i }); }
arangosh&gt; db.test.ensureIndex({ type: "skiplist", fields: [ "value" ] });
arangosh&gt; var explain = require("@arangodb/aql/explainer").explain;
arangosh&gt; explain("FOR i IN test FILTER i.value &gt; 97 SORT i.value RETURN i.value", {colors:false});
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_01_axplainer
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_01_explainCreate
<div class="example-container" id="AQLEXP_01_explainCreate_container">
<a class="anchorjs-link " href="#AQLEXP_01_explainCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_01_explainCreate_long" style="Display: none;">
<pre>
arangosh&gt; stmt = db._createStatement(<span class="hljs-string">"FOR i IN test FILTER i.value &gt; 97 SORT i.value RETURN i.value"</span>);
[object ArangoStatement]
arangosh&gt; stmt.explain();
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">10.143856189774723</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"projections"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"64886"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382032803069956"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">29</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">97</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">9</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">60.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">110.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"move-filters-up"</span>,
<span class="hljs-string">"remove-redundant-calculations"</span>,
<span class="hljs-string">"remove-unnecessary-calculations"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>,
<span class="hljs-string">"move-filters-up-2"</span>,
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"use-index-for-sort"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>,
<span class="hljs-string">"reduce-extraction-to-projection"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">110.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="AQLEXP_01_explainCreate_container_collapse" onclick="$('#AQLEXP_01_explainCreate_long').hide(); $('#AQLEXP_01_explainCreate_short').show(); window.location.hash='AQLEXP_01_explainCreate_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_01_explainCreate_short" onclick="$('#AQLEXP_01_explainCreate_short').hide(); $('#AQLEXP_01_explainCreate_long').show();">
<pre>
arangosh&gt; stmt = db._createStatement(<span class="hljs-string">"FOR i IN test FILTER i.value &gt; 97 SORT i.value RETURN i.value"</span>);
arangosh&gt; stmt.explain();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_01_explainCreate
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_02_explainOverview
<div class="example-container" id="AQLEXP_02_explainOverview_container">
<a class="anchorjs-link " href="#AQLEXP_02_explainOverview_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_02_explainOverview_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain().plan.nodes.map(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">node</span>) </span>{ <span class="hljs-keyword">return</span> node.type; });
[
<span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"ReturnNode"</span>
]
</pre>
<div id="AQLEXP_02_explainOverview_container_collapse" onclick="$('#AQLEXP_02_explainOverview_long').hide(); $('#AQLEXP_02_explainOverview_short').show(); window.location.hash='AQLEXP_02_explainOverview_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_02_explainOverview_short" onclick="$('#AQLEXP_02_explainOverview_short').hide(); $('#AQLEXP_02_explainOverview_long').show();">
<pre>
arangosh&gt; stmt.explain().plan.nodes.map(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">node</span>) </span>{ <span class="hljs-keyword">return</span> node.type; });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_02_explainOverview
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_03_explainRules
<div class="example-container" id="AQLEXP_03_explainRules_container">
<a class="anchorjs-link " href="#AQLEXP_03_explainRules_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_03_explainRules_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain().plan.rules;
[
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"move-filters-up"</span>,
<span class="hljs-string">"remove-redundant-calculations"</span>,
<span class="hljs-string">"remove-unnecessary-calculations"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>,
<span class="hljs-string">"move-filters-up-2"</span>,
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"use-index-for-sort"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>,
<span class="hljs-string">"reduce-extraction-to-projection"</span>
]
</pre>
<div id="AQLEXP_03_explainRules_container_collapse" onclick="$('#AQLEXP_03_explainRules_long').hide(); $('#AQLEXP_03_explainRules_short').show(); window.location.hash='AQLEXP_03_explainRules_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_03_explainRules_short" onclick="$('#AQLEXP_03_explainRules_short').hide(); $('#AQLEXP_03_explainRules_long').show();">
<pre>
arangosh&gt; stmt.explain().plan.rules;
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_03_explainRules
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_04_explainCollections
<div class="example-container" id="AQLEXP_04_explainCollections_container">
<a class="anchorjs-link " href="#AQLEXP_04_explainCollections_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_04_explainCollections_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain().plan.collections
[
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
]
</pre>
<div id="AQLEXP_04_explainCollections_container_collapse" onclick="$('#AQLEXP_04_explainCollections_long').hide(); $('#AQLEXP_04_explainCollections_short').show(); window.location.hash='AQLEXP_04_explainCollections_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_04_explainCollections_short" onclick="$('#AQLEXP_04_explainCollections_short').hide(); $('#AQLEXP_04_explainCollections_long').show();">
<pre>
arangosh&gt; stmt.explain().plan.collections
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_04_explainCollections
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_05_explainAllPlans
<div class="example-container" id="AQLEXP_05_explainAllPlans_container">
<a class="anchorjs-link " href="#AQLEXP_05_explainAllPlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_05_explainAllPlans_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">allPlans</span>: <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"plans"</span> : [
{
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">10.143856189774723</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"projections"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"64886"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382032803069956"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">29</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">97</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">9</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">60.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">110.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"move-filters-up"</span>,
<span class="hljs-string">"remove-redundant-calculations"</span>,
<span class="hljs-string">"remove-unnecessary-calculations"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>,
<span class="hljs-string">"move-filters-up-2"</span>,
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"use-index-for-sort"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>,
<span class="hljs-string">"reduce-extraction-to-projection"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">110.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
}
],
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
}
}
</pre>
<div id="AQLEXP_05_explainAllPlans_container_collapse" onclick="$('#AQLEXP_05_explainAllPlans_long').hide(); $('#AQLEXP_05_explainAllPlans_short').show(); window.location.hash='AQLEXP_05_explainAllPlans_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_05_explainAllPlans_short" onclick="$('#AQLEXP_05_explainAllPlans_short').hide(); $('#AQLEXP_05_explainAllPlans_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">allPlans</span>: <span class="hljs-literal">true</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_05_explainAllPlans
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_06_explainUnoptimizedPlans
<div class="example-container" id="AQLEXP_06_explainUnoptimizedPlans_container">
<a class="anchorjs-link " href="#AQLEXP_06_explainUnoptimizedPlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_06_explainUnoptimizedPlans_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: { <span class="hljs-attr">rules</span>: [ <span class="hljs-string">"-all"</span> ] } });
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateCollectionNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">102</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"random"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexHint"</span> : {
<span class="hljs-string">"forced"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">29</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">97</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"FilterNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">302</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">402</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SortNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1066.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"elements"</span> : [
{
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"stable"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"strategy"</span> : <span class="hljs-string">"standard"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1166.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">7</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1266.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [ ],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1266.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">34</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="AQLEXP_06_explainUnoptimizedPlans_container_collapse" onclick="$('#AQLEXP_06_explainUnoptimizedPlans_long').hide(); $('#AQLEXP_06_explainUnoptimizedPlans_short').show(); window.location.hash='AQLEXP_06_explainUnoptimizedPlans_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_06_explainUnoptimizedPlans_short" onclick="$('#AQLEXP_06_explainUnoptimizedPlans_short').hide(); $('#AQLEXP_06_explainUnoptimizedPlans_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: { <span class="hljs-attr">rules</span>: [ <span class="hljs-string">"-all"</span> ] } });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_06_explainUnoptimizedPlans
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_07_explainSingleRulePlans
<div class="example-container" id="AQLEXP_07_explainSingleRulePlans_container">
<a class="anchorjs-link " href="#AQLEXP_07_explainSingleRulePlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_07_explainSingleRulePlans_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: { <span class="hljs-attr">rules</span>: [ <span class="hljs-string">"-all"</span>, <span class="hljs-string">"+use-index-range"</span> ] } });
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateCollectionNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">102</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"random"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexHint"</span> : {
<span class="hljs-string">"forced"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">29</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">97</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"FilterNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">302</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">402</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SortNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1066.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"elements"</span> : [
{
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"stable"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"strategy"</span> : <span class="hljs-string">"standard"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1166.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">7</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1266.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [ ],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1266.3856189774724</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">34</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="AQLEXP_07_explainSingleRulePlans_container_collapse" onclick="$('#AQLEXP_07_explainSingleRulePlans_long').hide(); $('#AQLEXP_07_explainSingleRulePlans_short').show(); window.location.hash='AQLEXP_07_explainSingleRulePlans_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_07_explainSingleRulePlans_short" onclick="$('#AQLEXP_07_explainSingleRulePlans_short').hide(); $('#AQLEXP_07_explainSingleRulePlans_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: { <span class="hljs-attr">rules</span>: [ <span class="hljs-string">"-all"</span>, <span class="hljs-string">"+use-index-range"</span> ] } });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_07_explainSingleRulePlans
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_08_explainDisableSingleRulePlans
<div class="example-container" id="AQLEXP_08_explainDisableSingleRulePlans_container">
<a class="anchorjs-link " href="#AQLEXP_08_explainDisableSingleRulePlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_08_explainDisableSingleRulePlans_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: { <span class="hljs-attr">rules</span>: [ <span class="hljs-string">"-use-index-range"</span>, <span class="hljs-string">"-use-index-for-sort"</span> ] } });
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">10.143856189774723</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"projections"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"64886"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382032803069956"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">29</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">97</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">9</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">60.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SortNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">342.33666567851094</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"elements"</span> : [
{
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"stable"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"strategy"</span> : <span class="hljs-string">"standard"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">392.33666567851094</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"move-filters-up"</span>,
<span class="hljs-string">"remove-redundant-calculations"</span>,
<span class="hljs-string">"remove-unnecessary-calculations"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>,
<span class="hljs-string">"move-filters-up-2"</span>,
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>,
<span class="hljs-string">"reduce-extraction-to-projection"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">392.33666567851094</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="AQLEXP_08_explainDisableSingleRulePlans_container_collapse" onclick="$('#AQLEXP_08_explainDisableSingleRulePlans_long').hide(); $('#AQLEXP_08_explainDisableSingleRulePlans_short').show(); window.location.hash='AQLEXP_08_explainDisableSingleRulePlans_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_08_explainDisableSingleRulePlans_short" onclick="$('#AQLEXP_08_explainDisableSingleRulePlans_short').hide(); $('#AQLEXP_08_explainDisableSingleRulePlans_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">optimizer</span>: { <span class="hljs-attr">rules</span>: [ <span class="hljs-string">"-use-index-range"</span>, <span class="hljs-string">"-use-index-for-sort"</span> ] } });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_08_explainDisableSingleRulePlans
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_09_explainMaxNumberOfPlans
<div class="example-container" id="AQLEXP_09_explainMaxNumberOfPlans_container">
<a class="anchorjs-link " href="#AQLEXP_09_explainMaxNumberOfPlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_09_explainMaxNumberOfPlans_long" style="Display: none;">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">maxNumberOfPlans</span>: <span class="hljs-number">1</span> });
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">10.143856189774723</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"projections"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"64886"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382032803069956"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"value"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">29</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">97</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">9</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">60.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">110.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"move-filters-up"</span>,
<span class="hljs-string">"remove-redundant-calculations"</span>,
<span class="hljs-string">"remove-unnecessary-calculations"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>,
<span class="hljs-string">"move-filters-up-2"</span>,
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"use-index-for-sort"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>,
<span class="hljs-string">"reduce-extraction-to-projection"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">110.14385618977472</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">50</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="AQLEXP_09_explainMaxNumberOfPlans_container_collapse" onclick="$('#AQLEXP_09_explainMaxNumberOfPlans_long').hide(); $('#AQLEXP_09_explainMaxNumberOfPlans_short').show(); window.location.hash='AQLEXP_09_explainMaxNumberOfPlans_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_09_explainMaxNumberOfPlans_short" onclick="$('#AQLEXP_09_explainMaxNumberOfPlans_short').hide(); $('#AQLEXP_09_explainMaxNumberOfPlans_long').show();">
<pre>
arangosh&gt; stmt.explain({ <span class="hljs-attr">maxNumberOfPlans</span>: <span class="hljs-number">1</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_09_explainMaxNumberOfPlans
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-optimizer.md -->
@startDocuBlockInline AQLEXP_10_explainWarn
<div class="example-container" id="AQLEXP_10_explainWarn_container">
<a class="anchorjs-link " href="#AQLEXP_10_explainWarn_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="AQLEXP_10_explainWarn_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(<span class="hljs-string">"FOR i IN 1..10 RETURN 1 / 0"</span>)
arangosh&gt; stmt.explain().warnings;
[
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">1562</span>,
<span class="hljs-string">"message"</span> : <span class="hljs-string">"division by zero"</span>
}
]
</pre>
<div id="AQLEXP_10_explainWarn_container_collapse" onclick="$('#AQLEXP_10_explainWarn_long').hide(); $('#AQLEXP_10_explainWarn_short').show(); window.location.hash='AQLEXP_10_explainWarn_container';" class="example_show_button">Hide execution results</div></div>
<div id="AQLEXP_10_explainWarn_short" onclick="$('#AQLEXP_10_explainWarn_short').hide(); $('#AQLEXP_10_explainWarn_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(<span class="hljs-string">"FOR i IN 1..10 RETURN 1 / 0"</span>)
arangosh&gt; stmt.explain().warnings;
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock AQLEXP_10_explainWarn
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-combining-graph-traversals.md -->
@startDocuBlockInline COMBINING_GRAPH_01_create_graph
<div class="example-container" id="COMBINING_GRAPH_01_create_graph_container">
<a class="anchorjs-link " href="#COMBINING_GRAPH_01_create_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="COMBINING_GRAPH_01_create_graph_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> g = examples.loadGraph(<span class="hljs-string">"routeplanner"</span>);
</pre>
</div>
</div>
@endDocuBlock COMBINING_GRAPH_01_create_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-combining-graph-traversals.md -->
@startDocuBlockInline COMBINING_GRAPH_02_show_geo
<div class="example-container" id="COMBINING_GRAPH_02_show_geo_container">
<a class="anchorjs-link " href="#COMBINING_GRAPH_02_show_geo_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="COMBINING_GRAPH_02_show_geo_long">
<strong>Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
RETURN startCity._key
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"Hamburg"</span>
]</pre>
</div>
</div>
@endDocuBlock COMBINING_GRAPH_02_show_geo
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-combining-graph-traversals.md -->
@startDocuBlockInline COMBINING_GRAPH_03_explain_geo
<div class="example-container" id="COMBINING_GRAPH_03_explain_geo_container">
<a class="anchorjs-link " href="#COMBINING_GRAPH_03_explain_geo_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="COMBINING_GRAPH_03_explain_geo_long" style="Display: none;">
<strong>Explain Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
RETURN startCity._key
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre>
<strong>Explain output:</strong>
<pre>
Query String (119 chars, cacheable: true):
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
RETURN startCity._key
Execution plan:
Id NodeType Est. Comment
1 SingletonNode 1 * ROOT
7 IndexNode 3 - FOR startCity IN germanCity /* geo index scan, projections: `_key` */
5 CalculationNode 3 - LET #3 = startCity.`_key` /* attribute expression */ /* collections used: startCity : germanCity */
6 ReturnNode 3 - RETURN #3
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
7 idx_1646382032912121858 geo germanCity false true n/a [ `geometry` ] (GEO_DISTANCE([ 7.0998, 50.734 ], startCity.`geometry`) &lt; 400000)
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 move-filters-up
3 move-calculations-up-2
4 move-filters-up-2
5 geo-index-optimizer
6 remove-unnecessary-calculations-2
7 reduce-extraction-to-projection
</pre>
<div id="COMBINING_GRAPH_03_explain_geo_container_collapse" onclick="$('#COMBINING_GRAPH_03_explain_geo_long').hide(); $('#COMBINING_GRAPH_03_explain_geo_short').show(); window.location.hash='COMBINING_GRAPH_03_explain_geo_container';" class="example_show_button">Hide explain output</div></div>
<div id="COMBINING_GRAPH_03_explain_geo_short" onclick="$('#COMBINING_GRAPH_03_explain_geo_short').hide(); $('#COMBINING_GRAPH_03_explain_geo_long').show();">
<strong>Explain Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
RETURN startCity._key
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre><div class="example_show_button">Show explain output</div>
</div>
</div>
@endDocuBlock COMBINING_GRAPH_03_explain_geo
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-combining-graph-traversals.md -->
@startDocuBlockInline COMBINING_GRAPH_04_combine
<div class="example-container" id="COMBINING_GRAPH_04_combine_container">
<a class="anchorjs-link " href="#COMBINING_GRAPH_04_combine_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="COMBINING_GRAPH_04_combine_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> OUTBOUND startCity
GRAPH <span class="hljs-string">'routeplanner'</span>
RETURN {<span class="hljs-attr">startcity</span>: startCity._key, <span class="hljs-attr">traversedCity</span>: v._key}
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"startcity"</span>: <span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"traversedCity"</span>: <span class="hljs-string">"Lyon"</span>
},
{
<span class="hljs-string">"startcity"</span>: <span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"traversedCity"</span>: <span class="hljs-string">"Paris"</span>
},
{
<span class="hljs-string">"startcity"</span>: <span class="hljs-string">"Hamburg"</span>,
<span class="hljs-string">"traversedCity"</span>: <span class="hljs-string">"Cologne"</span>
},
{
<span class="hljs-string">"startcity"</span>: <span class="hljs-string">"Hamburg"</span>,
<span class="hljs-string">"traversedCity"</span>: <span class="hljs-string">"Paris"</span>
},
{
<span class="hljs-string">"startcity"</span>: <span class="hljs-string">"Hamburg"</span>,
<span class="hljs-string">"traversedCity"</span>: <span class="hljs-string">"Lyon"</span>
}
]</pre>
<div id="COMBINING_GRAPH_04_combine_container_collapse" onclick="$('#COMBINING_GRAPH_04_combine_long').hide(); $('#COMBINING_GRAPH_04_combine_short').show(); window.location.hash='COMBINING_GRAPH_04_combine_container';" class="example_show_button">Hide query result</div></div>
<div id="COMBINING_GRAPH_04_combine_short" onclick="$('#COMBINING_GRAPH_04_combine_short').hide(); $('#COMBINING_GRAPH_04_combine_long').show();">
<strong>Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> OUTBOUND startCity
GRAPH <span class="hljs-string">'routeplanner'</span>
RETURN {<span class="hljs-attr">startcity</span>: startCity._key, <span class="hljs-attr">traversedCity</span>: v._key}
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock COMBINING_GRAPH_04_combine
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-combining-graph-traversals.md -->
@startDocuBlockInline COMBINING_GRAPH_05_combine_let
<div class="example-container" id="COMBINING_GRAPH_05_combine_let_container">
<a class="anchorjs-link " href="#COMBINING_GRAPH_05_combine_let_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="COMBINING_GRAPH_05_combine_let_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
LET oneCity = (
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> OUTBOUND startCity
GRAPH <span class="hljs-string">'routeplanner'</span> RETURN v._key
)
RETURN {<span class="hljs-attr">startCity</span>: startCity._key, <span class="hljs-attr">connectedCities</span>: oneCity}
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"startCity"</span>: <span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"connectedCities"</span>: [
<span class="hljs-string">"Lyon"</span>,
<span class="hljs-string">"Paris"</span>
]
},
{
<span class="hljs-string">"startCity"</span>: <span class="hljs-string">"Hamburg"</span>,
<span class="hljs-string">"connectedCities"</span>: [
<span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"Paris"</span>,
<span class="hljs-string">"Lyon"</span>
]
}
]</pre>
<div id="COMBINING_GRAPH_05_combine_let_container_collapse" onclick="$('#COMBINING_GRAPH_05_combine_let_long').hide(); $('#COMBINING_GRAPH_05_combine_let_short').show(); window.location.hash='COMBINING_GRAPH_05_combine_let_container';" class="example_show_button">Hide query result</div></div>
<div id="COMBINING_GRAPH_05_combine_let_short" onclick="$('#COMBINING_GRAPH_05_combine_let_short').hide(); $('#COMBINING_GRAPH_05_combine_let_long').show();">
<strong>Query:</strong>
<pre>
FOR startCity IN germanCity
FILTER GEO_DISTANCE(@bonn, startCity.geometry) &lt; @radius
LET oneCity = (
FOR v, e, p IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> OUTBOUND startCity
GRAPH <span class="hljs-string">'routeplanner'</span> RETURN v._key
)
RETURN {<span class="hljs-attr">startCity</span>: startCity._key, <span class="hljs-attr">connectedCities</span>: oneCity}
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"bonn"</span>: [
<span class="hljs-number">7.0998</span>,
<span class="hljs-number">50.734</span>
],
<span class="hljs-string">"radius"</span>: <span class="hljs-number">400000</span>
}
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock COMBINING_GRAPH_05_combine_let
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-combining-graph-traversals.md -->
@startDocuBlockInline COMBINING_GRAPH_06_cleanup
<div class="example-container" id="COMBINING_GRAPH_06_cleanup_container">
<a class="anchorjs-link " href="#COMBINING_GRAPH_06_cleanup_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="COMBINING_GRAPH_06_cleanup_long">
<pre>
arangosh&gt; examples.dropGraph(<span class="hljs-string">"routeplanner"</span>);
</pre>
</div>
</div>
@endDocuBlock COMBINING_GRAPH_06_cleanup
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-date.md -->
@startDocuBlockInline working_with_date_time
<div class="example-container" id="working_with_date_time_container">
<a class="anchorjs-link " href="#working_with_date_time_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="working_with_date_time_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"exampleTime"</span>);
[ArangoCollection <span class="hljs-number">88789</span>, <span class="hljs-string">"exampleTime"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; <span class="hljs-keyword">var</span> timestamps = [<span class="hljs-string">"2014-05-07T14:19:09.522"</span>,<span class="hljs-string">"2014-05-07T21:19:09.522"</span>,<span class="hljs-string">"2014-05-08T04:19:09.522"</span>,<span class="hljs-string">"2014-05-08T11:19:09.522"</span>,<span class="hljs-string">"2014-05-08T18:19:09.522"</span>];
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">5</span>; i++) db.exampleTime.save({<span class="hljs-attr">value</span>:i, <span class="hljs-attr">ts</span>: timestamps[i]})
arangosh&gt; db._query(<span class="hljs-string">"FOR d IN exampleTime FILTER d.ts &gt; '2014-05-07T14:19:09.522' and d.ts &lt; '2014-05-08T18:19:09.522' RETURN d"</span>).toArray()
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88796"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"exampleTime/88796"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6glS--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"ts"</span> : <span class="hljs-string">"2014-05-07T21:19:09.522"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88798"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"exampleTime/88798"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6glW---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"ts"</span> : <span class="hljs-string">"2014-05-08T04:19:09.522"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"88800"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"exampleTime/88800"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6glW--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"ts"</span> : <span class="hljs-string">"2014-05-08T11:19:09.522"</span>
}
]
</pre>
<div id="working_with_date_time_container_collapse" onclick="$('#working_with_date_time_long').hide(); $('#working_with_date_time_short').show(); window.location.hash='working_with_date_time_container';" class="example_show_button">Hide execution results</div></div>
<div id="working_with_date_time_short" onclick="$('#working_with_date_time_short').hide(); $('#working_with_date_time_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"exampleTime"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> timestamps = [<span class="hljs-string">"2014-05-07T14:19:09.522"</span>,<span class="hljs-string">"2014-05-07T21:19:09.522"</span>,<span class="hljs-string">"2014-05-08T04:19:09.522"</span>,<span class="hljs-string">"2014-05-08T11:19:09.522"</span>,<span class="hljs-string">"2014-05-08T18:19:09.522"</span>];
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">5</span>; i++) db.exampleTime.save({<span class="hljs-attr">value</span>:i, <span class="hljs-attr">ts</span>: timestamps[i]})
arangosh&gt; db._query(<span class="hljs-string">"FOR d IN exampleTime FILTER d.ts &gt; '2014-05-07T14:19:09.522' and d.ts &lt; '2014-05-08T18:19:09.522' RETURN d"</span>).toArray()
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock working_with_date_time
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-queries-no-collections.md -->
@startDocuBlockInline aqlWithoutCollections_1
<div class="example-container" id="aqlWithoutCollections_1_container">
<a class="anchorjs-link " href="#aqlWithoutCollections_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlWithoutCollections_1_long">
<strong>Query:</strong>
<pre>
RETURN <span class="hljs-string">"this will be returned"</span>
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"this will be returned"</span>
]</pre>
</div>
</div>
@endDocuBlock aqlWithoutCollections_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-queries-no-collections.md -->
@startDocuBlockInline aqlWithoutCollections_2
<div class="example-container" id="aqlWithoutCollections_2_container">
<a class="anchorjs-link " href="#aqlWithoutCollections_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlWithoutCollections_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
LET array = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]
RETURN { array, <span class="hljs-attr">sum</span>: SUM(array) }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"array"</span>: [
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
],
<span class="hljs-string">"sum"</span>: <span class="hljs-number">10</span>
}
]</pre>
<div id="aqlWithoutCollections_2_container_collapse" onclick="$('#aqlWithoutCollections_2_long').hide(); $('#aqlWithoutCollections_2_short').show(); window.location.hash='aqlWithoutCollections_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlWithoutCollections_2_short" onclick="$('#aqlWithoutCollections_2_short').hide(); $('#aqlWithoutCollections_2_long').show();">
<strong>Query:</strong>
<pre>
LET array = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]
RETURN { array, <span class="hljs-attr">sum</span>: SUM(array) }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlWithoutCollections_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-queries-no-collections.md -->
@startDocuBlockInline aqlWithoutCollections_3
<div class="example-container" id="aqlWithoutCollections_3_container">
<a class="anchorjs-link " href="#aqlWithoutCollections_3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlWithoutCollections_3_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR year IN [ <span class="hljs-number">2011</span>, <span class="hljs-number">2012</span>, <span class="hljs-number">2013</span> ]
FOR quarter IN [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ]
RETURN {
year,
quarter,
<span class="hljs-attr">formatted</span>: CONCAT(quarter, <span class="hljs-string">" / "</span>, year)
}
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2011</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">1</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"1 / 2011"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2011</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">2</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"2 / 2011"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2011</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">3</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"3 / 2011"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2011</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">4</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"4 / 2011"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2012</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">1</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"1 / 2012"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2012</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">2</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"2 / 2012"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2012</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">3</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"3 / 2012"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2012</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">4</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"4 / 2012"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2013</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">1</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"1 / 2013"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2013</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">2</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"2 / 2013"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2013</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">3</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"3 / 2013"</span>
},
{
<span class="hljs-string">"year"</span>: <span class="hljs-number">2013</span>,
<span class="hljs-string">"quarter"</span>: <span class="hljs-number">4</span>,
<span class="hljs-string">"formatted"</span>: <span class="hljs-string">"4 / 2013"</span>
}
]</pre>
<div id="aqlWithoutCollections_3_container_collapse" onclick="$('#aqlWithoutCollections_3_long').hide(); $('#aqlWithoutCollections_3_short').show(); window.location.hash='aqlWithoutCollections_3_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlWithoutCollections_3_short" onclick="$('#aqlWithoutCollections_3_short').hide(); $('#aqlWithoutCollections_3_long').show();">
<strong>Query:</strong>
<pre>
FOR year IN [ <span class="hljs-number">2011</span>, <span class="hljs-number">2012</span>, <span class="hljs-number">2013</span> ]
FOR quarter IN [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ]
RETURN {
year,
quarter,
<span class="hljs-attr">formatted</span>: CONCAT(quarter, <span class="hljs-string">" / "</span>, year)
}
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlWithoutCollections_3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-parsing-queries.md -->
@startDocuBlockInline 11_workWithAQL_parseQueries
<div class="example-container" id="11_workWithAQL_parseQueries_container">
<a class="anchorjs-link " href="#11_workWithAQL_parseQueries_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="11_workWithAQL_parseQueries_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">"FOR doc IN @@collection FILTER doc.foo == @bar RETURN doc"</span>);
arangosh&gt; stmt.parse();
{
<span class="hljs-string">"bindVars"</span> : [
<span class="hljs-string">"bar"</span>,
<span class="hljs-string">"@collection"</span>
],
<span class="hljs-string">"collections"</span> : [ ],
<span class="hljs-string">"ast"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"for"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"variable"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"datasource parameter"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"@collection"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"no-op"</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"filter"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"foo"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"parameter"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"bar"</span>
}
]
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"return"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"doc"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
}
]
}
]
}
</pre>
<div id="11_workWithAQL_parseQueries_container_collapse" onclick="$('#11_workWithAQL_parseQueries_long').hide(); $('#11_workWithAQL_parseQueries_short').show(); window.location.hash='11_workWithAQL_parseQueries_container';" class="example_show_button">Hide execution results</div></div>
<div id="11_workWithAQL_parseQueries_short" onclick="$('#11_workWithAQL_parseQueries_short').hide(); $('#11_workWithAQL_parseQueries_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement(
........&gt; <span class="hljs-string">"FOR doc IN @@collection FILTER doc.foo == @bar RETURN doc"</span>);
arangosh&gt; stmt.parse();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 11_workWithAQL_parseQueries
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-multiple-paths.md -->
@startDocuBlockInline GRAPHTRAV_multiplePathSearch
<div class="example-container" id="GRAPHTRAV_multiplePathSearch_container">
<a class="anchorjs-link " href="#GRAPHTRAV_multiplePathSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_multiplePathSearch_long">
<strong>Query:</strong>
<pre>
RETURN LENGTH(
FOR v IN OUTBOUND
SHORTEST_PATH <span class="hljs-string">"mps_verts/A"</span> TO <span class="hljs-string">"mps_verts/C"</span> mps_edges
RETURN v
)
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">3</span>
]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_multiplePathSearch
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-multiple-paths.md -->
@startDocuBlockInline GRAPHTRAV_multiplePathSearch2
<div class="example-container" id="GRAPHTRAV_multiplePathSearch2_container">
<a class="anchorjs-link " href="#GRAPHTRAV_multiplePathSearch2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_multiplePathSearch2_long">
<strong>Query:</strong>
<pre>
FOR v, e, p IN <span class="hljs-number">2.</span><span class="hljs-number">.2</span> OUTBOUND <span class="hljs-string">"mps_verts/A"</span> mps_edges
FILTER v._id == <span class="hljs-string">"mps_verts/C"</span>
RETURN CONCAT_SEPARATOR(<span class="hljs-string">" -&gt; "</span>, p.vertices[*]._key)
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"A -&gt; B -&gt; C"</span>,
<span class="hljs-string">"A -&gt; D -&gt; C"</span>
]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_multiplePathSearch2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_01_create_graph
<div class="example-container" id="GRAPHKSP_01_create_graph_container">
<a class="anchorjs-link " href="#GRAPHKSP_01_create_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_01_create_graph_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
arangosh&gt; db.places.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Inverness"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Inverness"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vw6---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Inverness"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vx----"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Aberdeen"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vx---A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Leuchars"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"StAndrews"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/StAndrews"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vx---C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"StAndrews"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vx---E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Edinburgh"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Glasgow"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vx---G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Glasgow"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"York"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxC---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"York"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Carlisle"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxC--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Carlisle"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Birmingham"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxC--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Birmingham"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"London"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxC--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"London"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Brussels"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxC--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Brussels"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Cologne"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxG---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Cologne"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Toronto"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Toronto"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxG--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Toronto"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Winnipeg"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxG--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Winnipeg"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Saskatoon"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxG--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Saskatoon"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Edmonton"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxG--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Edmonton"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Jasper"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxK---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Jasper"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"Vancouver"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"places/Vancouver"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxK--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"Vancouver"</span>
}
]
arangosh&gt; db.connections.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65614"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65614"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Inverness"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxK--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65616"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65616"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Inverness"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxK--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65618"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65618"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxK--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65620"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65620"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Aberdeen"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxO---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65622"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65622"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxO--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65624"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65624"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxO--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65626"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65626"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxO--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65628"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65628"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxS---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65630"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65630"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxS--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65632"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65632"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edinburgh"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxS--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">4</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65634"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65634"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxS--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65636"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65636"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Glasgow"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxS--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65638"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65638"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxW--_"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65640"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65640"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxW--B"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65642"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65642"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxW--D"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65644"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65644"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Carlisle"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxW--F"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65646"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65646"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxa---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65648"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65648"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Birmingham"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxa--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65650"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65650"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/StAndrews"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxa--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">0.2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65652"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65652"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/StAndrews"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Leuchars"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxa--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">0.2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65654"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65654"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxe---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.8</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65656"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65656"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/York"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxe--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65658"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65658"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxe--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65660"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65660"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/London"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxe--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65662"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65662"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Cologne"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxe--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65664"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65664"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Cologne"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Brussels"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxi---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65666"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65666"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Toronto"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxi--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">36</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65668"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65668"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Toronto"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxi--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">35</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65670"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65670"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxi--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">12</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65672"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65672"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Winnipeg"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxi--G"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65674"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65674"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxm---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">12</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65676"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65676"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Saskatoon"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxm--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">17</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65678"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65678"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxm--C"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">6</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65680"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65680"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Edmonton"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxm--E"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65682"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65682"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Vancouver"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxq---"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">12</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"65684"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"connections/65684"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"places/Vancouver"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"places/Jasper"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5vxq--A"</span>,
<span class="hljs-string">"travelTime"</span> : <span class="hljs-number">13</span>
}
]
</pre>
<div id="GRAPHKSP_01_create_graph_container_collapse" onclick="$('#GRAPHKSP_01_create_graph_long').hide(); $('#GRAPHKSP_01_create_graph_short').show(); window.location.hash='GRAPHKSP_01_create_graph_container';" class="example_show_button">Hide execution results</div></div>
<div id="GRAPHKSP_01_create_graph_short" onclick="$('#GRAPHKSP_01_create_graph_short').hide(); $('#GRAPHKSP_01_create_graph_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
arangosh&gt; db.places.toArray();
arangosh&gt; db.connections.toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock GRAPHKSP_01_create_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_01_Aberdeen_to_London
<div class="example-container" id="GRAPHKSP_01_Aberdeen_to_London_container">
<a class="anchorjs-link " href="#GRAPHKSP_01_Aberdeen_to_London_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_01_Aberdeen_to_London_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR v, e IN OUTBOUND SHORTEST_PATH <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/London'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
RETURN { <span class="hljs-attr">place</span>: v.label, <span class="hljs-attr">travelTime</span>: e.travelTime }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"place"</span>: <span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"travelTime"</span>: <span class="hljs-literal">null</span>
},
{
<span class="hljs-string">"place"</span>: <span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"travelTime"</span>: <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"place"</span>: <span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"travelTime"</span>: <span class="hljs-number">1.5</span>
},
{
<span class="hljs-string">"place"</span>: <span class="hljs-string">"York"</span>,
<span class="hljs-string">"travelTime"</span>: <span class="hljs-number">3.5</span>
},
{
<span class="hljs-string">"place"</span>: <span class="hljs-string">"London"</span>,
<span class="hljs-string">"travelTime"</span>: <span class="hljs-number">1.8</span>
}
]</pre>
<div id="GRAPHKSP_01_Aberdeen_to_London_container_collapse" onclick="$('#GRAPHKSP_01_Aberdeen_to_London_long').hide(); $('#GRAPHKSP_01_Aberdeen_to_London_short').show(); window.location.hash='GRAPHKSP_01_Aberdeen_to_London_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHKSP_01_Aberdeen_to_London_short" onclick="$('#GRAPHKSP_01_Aberdeen_to_London_short').hide(); $('#GRAPHKSP_01_Aberdeen_to_London_long').show();">
<strong>Query:</strong>
<pre>
FOR v, e IN OUTBOUND SHORTEST_PATH <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/London'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
RETURN { <span class="hljs-attr">place</span>: v.label, <span class="hljs-attr">travelTime</span>: e.travelTime }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHKSP_01_Aberdeen_to_London
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_02_Aberdeen_to_London
<div class="example-container" id="GRAPHKSP_02_Aberdeen_to_London_container">
<a class="anchorjs-link " href="#GRAPHKSP_02_Aberdeen_to_London_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_02_Aberdeen_to_London_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/London'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
LIMIT <span class="hljs-number">1</span>
RETURN { <span class="hljs-attr">places</span>: p.vertices[*].label, <span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime }
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"York"</span>,
<span class="hljs-string">"London"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">3.5</span>,
<span class="hljs-number">1.8</span>
]
}
]</pre>
<div id="GRAPHKSP_02_Aberdeen_to_London_container_collapse" onclick="$('#GRAPHKSP_02_Aberdeen_to_London_long').hide(); $('#GRAPHKSP_02_Aberdeen_to_London_short').show(); window.location.hash='GRAPHKSP_02_Aberdeen_to_London_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHKSP_02_Aberdeen_to_London_short" onclick="$('#GRAPHKSP_02_Aberdeen_to_London_short').hide(); $('#GRAPHKSP_02_Aberdeen_to_London_long').show();">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/London'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
LIMIT <span class="hljs-number">1</span>
RETURN { <span class="hljs-attr">places</span>: p.vertices[*].label, <span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime }
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHKSP_02_Aberdeen_to_London
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_03_Aberdeen_to_London
<div class="example-container" id="GRAPHKSP_03_Aberdeen_to_London_container">
<a class="anchorjs-link " href="#GRAPHKSP_03_Aberdeen_to_London_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_03_Aberdeen_to_London_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/London'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
LIMIT <span class="hljs-number">3</span>
RETURN {
<span class="hljs-attr">places</span>: p.vertices[*].label,
<span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime,
<span class="hljs-attr">travelTimeTotal</span>: SUM(p.edges[*].travelTime)
}
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"York"</span>,
<span class="hljs-string">"London"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">3.5</span>,
<span class="hljs-number">1.8</span>
],
<span class="hljs-string">"travelTimeTotal"</span>: <span class="hljs-number">8.3</span>
},
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"York"</span>,
<span class="hljs-string">"Carlisle"</span>,
<span class="hljs-string">"Birmingham"</span>,
<span class="hljs-string">"London"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">3.5</span>,
<span class="hljs-number">3.5</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">1.5</span>
],
<span class="hljs-string">"travelTimeTotal"</span>: <span class="hljs-number">13.5</span>
},
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"Aberdeen"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"Glasgow"</span>,
<span class="hljs-string">"Carlisle"</span>,
<span class="hljs-string">"York"</span>,
<span class="hljs-string">"London"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2.5</span>,
<span class="hljs-number">1.8</span>
],
<span class="hljs-string">"travelTimeTotal"</span>: <span class="hljs-number">9.3</span>
}
]</pre>
<div id="GRAPHKSP_03_Aberdeen_to_London_container_collapse" onclick="$('#GRAPHKSP_03_Aberdeen_to_London_long').hide(); $('#GRAPHKSP_03_Aberdeen_to_London_short').show(); window.location.hash='GRAPHKSP_03_Aberdeen_to_London_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHKSP_03_Aberdeen_to_London_short" onclick="$('#GRAPHKSP_03_Aberdeen_to_London_short').hide(); $('#GRAPHKSP_03_Aberdeen_to_London_long').show();">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/London'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
LIMIT <span class="hljs-number">3</span>
RETURN {
<span class="hljs-attr">places</span>: p.vertices[*].label,
<span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime,
<span class="hljs-attr">travelTimeTotal</span>: SUM(p.edges[*].travelTime)
}
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHKSP_03_Aberdeen_to_London
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_04_Aberdeen_to_Toronto
<div class="example-container" id="GRAPHKSP_04_Aberdeen_to_Toronto_container">
<a class="anchorjs-link " href="#GRAPHKSP_04_Aberdeen_to_Toronto_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_04_Aberdeen_to_Toronto_long">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/Aberdeen'</span> TO <span class="hljs-string">'places/Toronto'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
LIMIT <span class="hljs-number">3</span>
RETURN {
<span class="hljs-attr">places</span>: p.vertices[*].label,
<span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime,
<span class="hljs-attr">travelTimeTotal</span>: SUM(p.edges[*].travelTime)
}
</pre>
<strong>Query results:</strong>
<pre>
[]</pre>
</div>
</div>
@endDocuBlock GRAPHKSP_04_Aberdeen_to_Toronto
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_05_StAndrews_to_Cologne
<div class="example-container" id="GRAPHKSP_05_StAndrews_to_Cologne_container">
<a class="anchorjs-link " href="#GRAPHKSP_05_StAndrews_to_Cologne_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_05_StAndrews_to_Cologne_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/StAndrews'</span> TO <span class="hljs-string">'places/Cologne'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
OPTIONS {
<span class="hljs-attr">weightAttribute</span>: <span class="hljs-string">'travelTime'</span>,
<span class="hljs-attr">defaultWeight</span>: <span class="hljs-number">15</span>
}
LIMIT <span class="hljs-number">3</span>
RETURN {
<span class="hljs-attr">places</span>: p.vertices[*].label,
<span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime,
<span class="hljs-attr">travelTimeTotal</span>: SUM(p.edges[*].travelTime)
}
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"StAndrews"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"York"</span>,
<span class="hljs-string">"London"</span>,
<span class="hljs-string">"Brussels"</span>,
<span class="hljs-string">"Cologne"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">0.2</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">3.5</span>,
<span class="hljs-number">1.8</span>,
<span class="hljs-number">2.5</span>,
<span class="hljs-number">2</span>
],
<span class="hljs-string">"travelTimeTotal"</span>: <span class="hljs-number">11.5</span>
},
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"StAndrews"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"Glasgow"</span>,
<span class="hljs-string">"Carlisle"</span>,
<span class="hljs-string">"Birmingham"</span>,
<span class="hljs-string">"London"</span>,
<span class="hljs-string">"Brussels"</span>,
<span class="hljs-string">"Cologne"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">0.2</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">2.5</span>,
<span class="hljs-number">2</span>
],
<span class="hljs-string">"travelTimeTotal"</span>: <span class="hljs-number">11.7</span>
},
{
<span class="hljs-string">"places"</span>: [
<span class="hljs-string">"StAndrews"</span>,
<span class="hljs-string">"Leuchars"</span>,
<span class="hljs-string">"Edinburgh"</span>,
<span class="hljs-string">"Glasgow"</span>,
<span class="hljs-string">"Carlisle"</span>,
<span class="hljs-string">"York"</span>,
<span class="hljs-string">"London"</span>,
<span class="hljs-string">"Brussels"</span>,
<span class="hljs-string">"Cologne"</span>
],
<span class="hljs-string">"travelTimes"</span>: [
<span class="hljs-number">0.2</span>,
<span class="hljs-number">1.5</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2.5</span>,
<span class="hljs-number">1.8</span>,
<span class="hljs-number">2.5</span>,
<span class="hljs-number">2</span>
],
<span class="hljs-string">"travelTimeTotal"</span>: <span class="hljs-number">12.5</span>
}
]</pre>
<div id="GRAPHKSP_05_StAndrews_to_Cologne_container_collapse" onclick="$('#GRAPHKSP_05_StAndrews_to_Cologne_long').hide(); $('#GRAPHKSP_05_StAndrews_to_Cologne_short').show(); window.location.hash='GRAPHKSP_05_StAndrews_to_Cologne_container';" class="example_show_button">Hide query result</div></div>
<div id="GRAPHKSP_05_StAndrews_to_Cologne_short" onclick="$('#GRAPHKSP_05_StAndrews_to_Cologne_short').hide(); $('#GRAPHKSP_05_StAndrews_to_Cologne_long').show();">
<strong>Query:</strong>
<pre>
FOR p IN OUTBOUND K_SHORTEST_PATHS <span class="hljs-string">'places/StAndrews'</span> TO <span class="hljs-string">'places/Cologne'</span>
GRAPH <span class="hljs-string">'kShortestPathsGraph'</span>
OPTIONS {
<span class="hljs-attr">weightAttribute</span>: <span class="hljs-string">'travelTime'</span>,
<span class="hljs-attr">defaultWeight</span>: <span class="hljs-number">15</span>
}
LIMIT <span class="hljs-number">3</span>
RETURN {
<span class="hljs-attr">places</span>: p.vertices[*].label,
<span class="hljs-attr">travelTimes</span>: p.edges[*].travelTime,
<span class="hljs-attr">travelTimeTotal</span>: SUM(p.edges[*].travelTime)
}
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock GRAPHKSP_05_StAndrews_to_Cologne
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-kshortest-paths.md -->
@startDocuBlockInline GRAPHKSP_99_drop_graph
<div class="example-container" id="GRAPHKSP_99_drop_graph_container">
<a class="anchorjs-link " href="#GRAPHKSP_99_drop_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHKSP_99_drop_graph_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; examples.dropGraph(<span class="hljs-string">"kShortestPathsGraph"</span>);
</pre>
</div>
</div>
@endDocuBlock GRAPHKSP_99_drop_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-join.md -->
@startDocuBlockInline joinTuples
<div class="example-container" id="joinTuples_container">
<a class="anchorjs-link " href="#joinTuples_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="joinTuples_long" style="Display: none;">
<strong>Query:</strong>
<pre>
FOR u IN users
FILTER u.active == <span class="hljs-literal">true</span>
LIMIT <span class="hljs-number">0</span>, <span class="hljs-number">4</span>
FOR f IN relations
FILTER f.type == @friend &amp;&amp; f.friendOf == u.userId
RETURN {
<span class="hljs-string">"user"</span> : u.name,
<span class="hljs-string">"friendId"</span> : f.thisUser
}
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"friend"</span>: <span class="hljs-string">"friend"</span>
}
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Abigail"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Abigail"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Abigail"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">4</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Fred"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Fred"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Mary"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">4</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Mary"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Mariah"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"user"</span>: <span class="hljs-string">"Mariah"</span>,
<span class="hljs-string">"friendId"</span>: <span class="hljs-number">2</span>
}
]</pre>
<div id="joinTuples_container_collapse" onclick="$('#joinTuples_long').hide(); $('#joinTuples_short').show(); window.location.hash='joinTuples_container';" class="example_show_button">Hide query result</div></div>
<div id="joinTuples_short" onclick="$('#joinTuples_short').hide(); $('#joinTuples_long').show();">
<strong>Query:</strong>
<pre>
FOR u IN users
FILTER u.active == <span class="hljs-literal">true</span>
LIMIT <span class="hljs-number">0</span>, <span class="hljs-number">4</span>
FOR f IN relations
FILTER f.type == @friend &amp;&amp; f.friendOf == u.userId
RETURN {
<span class="hljs-string">"user"</span> : u.name,
<span class="hljs-string">"friendId"</span> : f.thisUser
}
</pre>
<strong>Bind Values:</strong>
<pre>
{
<span class="hljs-string">"friend"</span>: <span class="hljs-string">"friend"</span>
}
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock joinTuples
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 01_workWithAQL_all
<div class="example-container" id="01_workWithAQL_all_container">
<a class="anchorjs-link " href="#01_workWithAQL_all_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="01_workWithAQL_all_long" style="Display: none;">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"mycollection"</span>)
[ArangoCollection <span class="hljs-number">4517</span>, <span class="hljs-string">"mycollection"</span> (type <span class="hljs-built_in">document</span>, status loaded)]
arangosh&gt; db.mycollection.save({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"testKey"</span>, <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> })
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mycollection/testKey"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"testKey"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5o0O--A"</span>
}
arangosh&gt; db._query(<span class="hljs-string">'FOR my IN mycollection RETURN my._key'</span>).toArray()
[
<span class="hljs-string">"testKey"</span>
]
</pre>
<div id="01_workWithAQL_all_container_collapse" onclick="$('#01_workWithAQL_all_long').hide(); $('#01_workWithAQL_all_short').show(); window.location.hash='01_workWithAQL_all_container';" class="example_show_button">Hide execution results</div></div>
<div id="01_workWithAQL_all_short" onclick="$('#01_workWithAQL_all_short').hide(); $('#01_workWithAQL_all_long').show();">
<pre>
arangosh&gt; db._create(<span class="hljs-string">"mycollection"</span>)
arangosh&gt; db.mycollection.save({ <span class="hljs-attr">_key</span>: <span class="hljs-string">"testKey"</span>, <span class="hljs-attr">Hello</span> : <span class="hljs-string">"World"</span> })
arangosh&gt; db._query(<span class="hljs-string">'FOR my IN mycollection RETURN my._key'</span>).toArray()
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 01_workWithAQL_all
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 02_workWithAQL_bindValues
<div class="example-container" id="02_workWithAQL_bindValues_container">
<a class="anchorjs-link " href="#02_workWithAQL_bindValues_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="02_workWithAQL_bindValues_long">
<pre>
arangosh&gt; db._query(
........&gt; <span class="hljs-string">'FOR c IN @@collection FILTER c._key == @key RETURN c._key'</span>, {
........&gt; <span class="hljs-string">'@collection'</span>: <span class="hljs-string">'mycollection'</span>,
........&gt; <span class="hljs-string">'key'</span>: <span class="hljs-string">'testKey'</span>
........&gt; }).toArray();
[
<span class="hljs-string">"testKey"</span>
]
</pre>
</div>
</div>
@endDocuBlock 02_workWithAQL_bindValues
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 02_workWithAQL_aqlQuery
<div class="example-container" id="02_workWithAQL_aqlQuery_container">
<a class="anchorjs-link " href="#02_workWithAQL_aqlQuery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="02_workWithAQL_aqlQuery_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> key = <span class="hljs-string">'testKey'</span>;
arangosh&gt; db._query(
........&gt; aql<span class="hljs-string">`FOR c IN mycollection FILTER c._key == <span class="hljs-subst">${key}</span> RETURN c._key`</span>
........&gt; ).toArray();
[
<span class="hljs-string">"testKey"</span>
]
</pre>
</div>
</div>
@endDocuBlock 02_workWithAQL_aqlQuery
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 02_workWithAQL_aqlCollectionQuery
<div class="example-container" id="02_workWithAQL_aqlCollectionQuery_container">
<a class="anchorjs-link " href="#02_workWithAQL_aqlCollectionQuery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="02_workWithAQL_aqlCollectionQuery_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> key = <span class="hljs-string">'testKey'</span>;
arangosh&gt; db._query(aql<span class="hljs-string">`FOR doc IN <span class="hljs-subst">${ db.mycollection }</span> RETURN doc`</span>
........&gt; ).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"testKey"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"mycollection/testKey"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5o0O--A"</span>,
<span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span>
}
]
</pre>
<div id="02_workWithAQL_aqlCollectionQuery_container_collapse" onclick="$('#02_workWithAQL_aqlCollectionQuery_long').hide(); $('#02_workWithAQL_aqlCollectionQuery_short').show(); window.location.hash='02_workWithAQL_aqlCollectionQuery_container';" class="example_show_button">Hide execution results</div></div>
<div id="02_workWithAQL_aqlCollectionQuery_short" onclick="$('#02_workWithAQL_aqlCollectionQuery_short').hide(); $('#02_workWithAQL_aqlCollectionQuery_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> key = <span class="hljs-string">'testKey'</span>;
arangosh&gt; db._query(aql<span class="hljs-string">`FOR doc IN <span class="hljs-subst">${ db.mycollection }</span> RETURN doc`</span>
........&gt; ).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 02_workWithAQL_aqlCollectionQuery
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 03_workWithAQL_getExtra
<div class="example-container" id="03_workWithAQL_getExtra_container">
<a class="anchorjs-link " href="#03_workWithAQL_getExtra_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="03_workWithAQL_getExtra_long" style="Display: none;">
<pre>
arangosh&gt; db._query(<span class="hljs-string">`FOR i IN 1..100
........&gt; INSERT { _key: CONCAT('test', TO_STRING(i)) }
........&gt; INTO mycollection`</span>
........&gt; ).getExtra();
{
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0021257400512695312</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">98688</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
}
</pre>
<div id="03_workWithAQL_getExtra_container_collapse" onclick="$('#03_workWithAQL_getExtra_long').hide(); $('#03_workWithAQL_getExtra_short').show(); window.location.hash='03_workWithAQL_getExtra_container';" class="example_show_button">Hide execution results</div></div>
<div id="03_workWithAQL_getExtra_short" onclick="$('#03_workWithAQL_getExtra_short').hide(); $('#03_workWithAQL_getExtra_long').show();">
<pre>
arangosh&gt; db._query(<span class="hljs-string">`FOR i IN 1..100
........&gt; INSERT { _key: CONCAT('test', TO_STRING(i)) }
........&gt; INTO mycollection`</span>
........&gt; ).getExtra();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 03_workWithAQL_getExtra
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 02_workWithAQL_memoryLimit
<div class="example-container" id="02_workWithAQL_memoryLimit_container">
<a class="anchorjs-link " href="#02_workWithAQL_memoryLimit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="02_workWithAQL_memoryLimit_long">
<pre>
arangosh&gt; db._query(
........&gt; <span class="hljs-string">'FOR i IN 1..100000 SORT i RETURN i'</span>, {}, {
........&gt; memoryLimit: <span class="hljs-number">100000</span>
........&gt; }).toArray();
[ArangoError <span class="hljs-number">32</span>: AQL: query would use more memory than allowed (<span class="hljs-keyword">while</span> executing)]
</pre>
</div>
</div>
@endDocuBlock 02_workWithAQL_memoryLimit
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 04_workWithAQL_statements1
<div class="example-container" id="04_workWithAQL_statements1_container">
<a class="anchorjs-link " href="#04_workWithAQL_statements1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="04_workWithAQL_statements1_long">
<pre>
arangosh&gt; stmt = db._createStatement( {
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">"FOR i IN [ 1, 2 ] RETURN i * 2"</span> } );
[object ArangoStatement]
</pre>
</div>
</div>
@endDocuBlock 04_workWithAQL_statements1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements2
<div class="example-container" id="05_workWithAQL_statements2_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements2_long" style="Display: none;">
<pre>
arangosh&gt; c = stmt.execute();
[
<span class="hljs-number">2</span>,
<span class="hljs-number">4</span>
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="05_workWithAQL_statements2_container_collapse" onclick="$('#05_workWithAQL_statements2_long').hide(); $('#05_workWithAQL_statements2_short').show(); window.location.hash='05_workWithAQL_statements2_container';" class="example_show_button">Hide execution results</div></div>
<div id="05_workWithAQL_statements2_short" onclick="$('#05_workWithAQL_statements2_short').hide(); $('#05_workWithAQL_statements2_long').show();">
<pre>
arangosh&gt; c = stmt.execute();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements3
<div class="example-container" id="05_workWithAQL_statements3_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements3_long">
<pre>
arangosh&gt; c.toArray();
[
<span class="hljs-number">2</span>,
<span class="hljs-number">4</span>
]
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements4
<div class="example-container" id="05_workWithAQL_statements4_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements4_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements4_long">
<pre>
arangosh&gt; <span class="hljs-keyword">while</span> (c.hasNext()) { <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).print(c.next()); }
<span class="hljs-number">2</span>
<span class="hljs-number">4</span>
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements4
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements5
<div class="example-container" id="05_workWithAQL_statements5_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements5_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements5_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement( {
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">"FOR i IN [ @one, @two ] RETURN i * 2"</span> } );
arangosh&gt; stmt.bind(<span class="hljs-string">"one"</span>, <span class="hljs-number">1</span>);
arangosh&gt; stmt.bind(<span class="hljs-string">"two"</span>, <span class="hljs-number">2</span>);
arangosh&gt; c = stmt.execute();
[
<span class="hljs-number">2</span>,
<span class="hljs-number">4</span>
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="05_workWithAQL_statements5_container_collapse" onclick="$('#05_workWithAQL_statements5_long').hide(); $('#05_workWithAQL_statements5_short').show(); window.location.hash='05_workWithAQL_statements5_container';" class="example_show_button">Hide execution results</div></div>
<div id="05_workWithAQL_statements5_short" onclick="$('#05_workWithAQL_statements5_short').hide(); $('#05_workWithAQL_statements5_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> stmt = db._createStatement( {
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">"FOR i IN [ @one, @two ] RETURN i * 2"</span> } );
arangosh&gt; stmt.bind(<span class="hljs-string">"one"</span>, <span class="hljs-number">1</span>);
arangosh&gt; stmt.bind(<span class="hljs-string">"two"</span>, <span class="hljs-number">2</span>);
arangosh&gt; c = stmt.execute();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements5
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements6
<div class="example-container" id="05_workWithAQL_statements6_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements6_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements6_long">
<pre>
arangosh&gt; c.toArray();
[
<span class="hljs-number">2</span>,
<span class="hljs-number">4</span>
]
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements6
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements7
<div class="example-container" id="05_workWithAQL_statements7_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements7_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements7_long">
<pre>
arangosh&gt; <span class="hljs-keyword">while</span> (c.hasNext()) { <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb"</span>).print(c.next()); }
<span class="hljs-number">2</span>
<span class="hljs-number">4</span>
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements7
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements8
<div class="example-container" id="05_workWithAQL_statements8_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements8_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements8_long">
<pre>
arangosh&gt; stmt = db._createStatement( {
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">"FOR i IN [ @one, @two ] RETURN i * 2"</span>,
........&gt; <span class="hljs-string">"bindVars"</span>: {
........&gt; <span class="hljs-string">"one"</span>: <span class="hljs-number">1</span>,
........&gt; <span class="hljs-string">"two"</span>: <span class="hljs-number">2</span>
........&gt; }
........&gt; } );
[object ArangoStatement]
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements8
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements9
<div class="example-container" id="05_workWithAQL_statements9_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements9_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements9_long">
<pre>
arangosh&gt; stmt = db._createStatement( {
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">"FOR i IN [ 1, 2, 3, 4 ] RETURN i"</span>,
........&gt; <span class="hljs-string">"count"</span>: <span class="hljs-literal">true</span> } );
[object ArangoStatement]
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements9
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 05_workWithAQL_statements10
<div class="example-container" id="05_workWithAQL_statements10_container">
<a class="anchorjs-link " href="#05_workWithAQL_statements10_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="05_workWithAQL_statements10_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> c = stmt.execute();
arangosh&gt; c.count();
<span class="hljs-number">4</span>
</pre>
</div>
</div>
@endDocuBlock 05_workWithAQL_statements10
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 06_workWithAQL_statements11
<div class="example-container" id="06_workWithAQL_statements11_container">
<a class="anchorjs-link " href="#06_workWithAQL_statements11_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="06_workWithAQL_statements11_long">
<pre>
arangosh&gt; stmt = db._createStatement( {
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">"FOR i IN [ 1, 2, 3, 4 ] RETURN i"</span>,
........&gt; options: {<span class="hljs-string">"profile"</span>: <span class="hljs-literal">true</span>}} );
[object ArangoStatement]
</pre>
</div>
</div>
@endDocuBlock 06_workWithAQL_statements11
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 06_workWithAQL_statements12
<div class="example-container" id="06_workWithAQL_statements12_container">
<a class="anchorjs-link " href="#06_workWithAQL_statements12_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="06_workWithAQL_statements12_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> c = stmt.execute();
arangosh&gt; c.getExtra();
{
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00009703636169433594</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">34280</span>
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"profile"</span> : {
<span class="hljs-string">"initializing"</span> : <span class="hljs-number">0.0000019073486328125</span>,
<span class="hljs-string">"parsing"</span> : <span class="hljs-number">0.000014066696166992188</span>,
<span class="hljs-string">"optimizing ast"</span> : <span class="hljs-number">0.0000019073486328125</span>,
<span class="hljs-string">"loading collections"</span> : <span class="hljs-number">0.0000045299530029296875</span>,
<span class="hljs-string">"instantiating plan"</span> : <span class="hljs-number">0.000007152557373046875</span>,
<span class="hljs-string">"optimizing plan"</span> : <span class="hljs-number">0.000028371810913085938</span>,
<span class="hljs-string">"executing"</span> : <span class="hljs-number">0.000018358230590820312</span>,
<span class="hljs-string">"finalizing"</span> : <span class="hljs-number">0.000013589859008789062</span>
}
}
</pre>
<div id="06_workWithAQL_statements12_container_collapse" onclick="$('#06_workWithAQL_statements12_long').hide(); $('#06_workWithAQL_statements12_short').show(); window.location.hash='06_workWithAQL_statements12_container';" class="example_show_button">Hide execution results</div></div>
<div id="06_workWithAQL_statements12_short" onclick="$('#06_workWithAQL_statements12_short').hide(); $('#06_workWithAQL_statements12_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> c = stmt.execute();
arangosh&gt; c.getExtra();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 06_workWithAQL_statements12
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/invocation-with-arangosh.md -->
@startDocuBlockInline 06_workWithAQL_statements13
<div class="example-container" id="06_workWithAQL_statements13_container">
<a class="anchorjs-link " href="#06_workWithAQL_statements13_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="06_workWithAQL_statements13_long" style="Display: none;">
<pre>
arangosh&gt; db._parse( <span class="hljs-string">"FOR i IN [ 1, 2 ] RETURN i"</span> );
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"parsed"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"collections"</span> : [ ],
<span class="hljs-string">"bindVars"</span> : [ ],
<span class="hljs-string">"ast"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"for"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"variable"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"array"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"no-op"</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"return"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
}
]
}
]
}
</pre>
<div id="06_workWithAQL_statements13_container_collapse" onclick="$('#06_workWithAQL_statements13_long').hide(); $('#06_workWithAQL_statements13_short').show(); window.location.hash='06_workWithAQL_statements13_container';" class="example_show_button">Hide execution results</div></div>
<div id="06_workWithAQL_statements13_short" onclick="$('#06_workWithAQL_statements13_short').hide(); $('#06_workWithAQL_statements13_long').show();">
<pre>
arangosh&gt; db._parse( <span class="hljs-string">"FOR i IN [ 1, 2 ] RETURN i"</span> );
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 06_workWithAQL_statements13
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-query-statistics.md -->
@startDocuBlockInline 06_workWithAQL_statementsExtra
<div class="example-container" id="06_workWithAQL_statementsExtra_container">
<a class="anchorjs-link " href="#06_workWithAQL_statementsExtra_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="06_workWithAQL_statementsExtra_long" style="Display: none;">
<pre>
arangosh&gt; db._query(<span class="hljs-string">`
........&gt; FOR i IN 1..@count INSERT
........&gt; { _key: CONCAT('anothertest', TO_STRING(i)) }
........&gt; INTO mycollection`</span>,
........&gt; {<span class="hljs-attr">count</span>: <span class="hljs-number">100</span>},
........&gt; {},
........&gt; {<span class="hljs-attr">fullCount</span>: <span class="hljs-literal">true</span>}
........&gt; ).getExtra();
{
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"fullCount"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0022063255310058594</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">98744</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
}
arangosh&gt; db._query({
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">`FOR i IN 200..@count INSERT
........&gt; { _key: CONCAT('anothertest', TO_STRING(i)) }
........&gt; INTO mycollection`</span>,
........&gt; <span class="hljs-string">"bindVars"</span>: {<span class="hljs-attr">count</span>: <span class="hljs-number">300</span>},
........&gt; <span class="hljs-string">"options"</span>: { <span class="hljs-attr">fullCount</span>: <span class="hljs-literal">true</span>}
........&gt; }).getExtra();
{
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">101</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"fullCount"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0019061565399169922</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">98744</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
}
</pre>
<div id="06_workWithAQL_statementsExtra_container_collapse" onclick="$('#06_workWithAQL_statementsExtra_long').hide(); $('#06_workWithAQL_statementsExtra_short').show(); window.location.hash='06_workWithAQL_statementsExtra_container';" class="example_show_button">Hide execution results</div></div>
<div id="06_workWithAQL_statementsExtra_short" onclick="$('#06_workWithAQL_statementsExtra_short').hide(); $('#06_workWithAQL_statementsExtra_long').show();">
<pre>
arangosh&gt; db._query(<span class="hljs-string">`
........&gt; FOR i IN 1..@count INSERT
........&gt; { _key: CONCAT('anothertest', TO_STRING(i)) }
........&gt; INTO mycollection`</span>,
........&gt; {<span class="hljs-attr">count</span>: <span class="hljs-number">100</span>},
........&gt; {},
........&gt; {<span class="hljs-attr">fullCount</span>: <span class="hljs-literal">true</span>}
........&gt; ).getExtra();
arangosh&gt; db._query({
........&gt; <span class="hljs-string">"query"</span>: <span class="hljs-string">`FOR i IN 200..@count INSERT
........&gt; { _key: CONCAT('anothertest', TO_STRING(i)) }
........&gt; INTO mycollection`</span>,
........&gt; <span class="hljs-string">"bindVars"</span>: {<span class="hljs-attr">count</span>: <span class="hljs-number">300</span>},
........&gt; <span class="hljs-string">"options"</span>: { <span class="hljs-attr">fullCount</span>: <span class="hljs-literal">true</span>}
........&gt; }).getExtra();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 06_workWithAQL_statementsExtra
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoLineString_1
<div class="example-container" id="aqlGeoLineString_1_container">
<a class="anchorjs-link " href="#aqlGeoLineString_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoLineString_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_LINESTRING([
[<span class="hljs-number">35</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">45</span>]
])
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"LineString"</span>,
<span class="hljs-string">"coordinates"</span>: [
[
<span class="hljs-number">35</span>,
<span class="hljs-number">10</span>
],
[
<span class="hljs-number">45</span>,
<span class="hljs-number">45</span>
]
]
}
]</pre>
<div id="aqlGeoLineString_1_container_collapse" onclick="$('#aqlGeoLineString_1_long').hide(); $('#aqlGeoLineString_1_short').show(); window.location.hash='aqlGeoLineString_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoLineString_1_short" onclick="$('#aqlGeoLineString_1_short').hide(); $('#aqlGeoLineString_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_LINESTRING([
[<span class="hljs-number">35</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">45</span>]
])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoLineString_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoMultiLineString_1
<div class="example-container" id="aqlGeoMultiLineString_1_container">
<a class="anchorjs-link " href="#aqlGeoMultiLineString_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoMultiLineString_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_MULTILINESTRING([
[[<span class="hljs-number">100.0</span>, <span class="hljs-number">0.0</span>], [<span class="hljs-number">101.0</span>, <span class="hljs-number">1.0</span>]],
[[<span class="hljs-number">102.0</span>, <span class="hljs-number">2.0</span>], [<span class="hljs-number">101.0</span>, <span class="hljs-number">2.3</span>]]
])
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"MultiLineString"</span>,
<span class="hljs-string">"coordinates"</span>: [
[
[
<span class="hljs-number">100</span>,
<span class="hljs-number">0</span>
],
[
<span class="hljs-number">101</span>,
<span class="hljs-number">1</span>
]
],
[
[
<span class="hljs-number">102</span>,
<span class="hljs-number">2</span>
],
[
<span class="hljs-number">101</span>,
<span class="hljs-number">2.3</span>
]
]
]
}
]</pre>
<div id="aqlGeoMultiLineString_1_container_collapse" onclick="$('#aqlGeoMultiLineString_1_long').hide(); $('#aqlGeoMultiLineString_1_short').show(); window.location.hash='aqlGeoMultiLineString_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoMultiLineString_1_short" onclick="$('#aqlGeoMultiLineString_1_short').hide(); $('#aqlGeoMultiLineString_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_MULTILINESTRING([
[[<span class="hljs-number">100.0</span>, <span class="hljs-number">0.0</span>], [<span class="hljs-number">101.0</span>, <span class="hljs-number">1.0</span>]],
[[<span class="hljs-number">102.0</span>, <span class="hljs-number">2.0</span>], [<span class="hljs-number">101.0</span>, <span class="hljs-number">2.3</span>]]
])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoMultiLineString_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoMultiPoint_1
<div class="example-container" id="aqlGeoMultiPoint_1_container">
<a class="anchorjs-link " href="#aqlGeoMultiPoint_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoMultiPoint_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_MULTIPOINT([
[<span class="hljs-number">35</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">45</span>]
])
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"MultiPoint"</span>,
<span class="hljs-string">"coordinates"</span>: [
[
<span class="hljs-number">35</span>,
<span class="hljs-number">10</span>
],
[
<span class="hljs-number">45</span>,
<span class="hljs-number">45</span>
]
]
}
]</pre>
<div id="aqlGeoMultiPoint_1_container_collapse" onclick="$('#aqlGeoMultiPoint_1_long').hide(); $('#aqlGeoMultiPoint_1_short').show(); window.location.hash='aqlGeoMultiPoint_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoMultiPoint_1_short" onclick="$('#aqlGeoMultiPoint_1_short').hide(); $('#aqlGeoMultiPoint_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_MULTIPOINT([
[<span class="hljs-number">35</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">45</span>]
])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoMultiPoint_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoPoint_1
<div class="example-container" id="aqlGeoPoint_1_container">
<a class="anchorjs-link " href="#aqlGeoPoint_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoPoint_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_POINT(<span class="hljs-number">1.0</span>, <span class="hljs-number">2.0</span>)
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"Point"</span>,
<span class="hljs-string">"coordinates"</span>: [
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>
]
}
]</pre>
<div id="aqlGeoPoint_1_container_collapse" onclick="$('#aqlGeoPoint_1_long').hide(); $('#aqlGeoPoint_1_short').show(); window.location.hash='aqlGeoPoint_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoPoint_1_short" onclick="$('#aqlGeoPoint_1_short').hide(); $('#aqlGeoPoint_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_POINT(<span class="hljs-number">1.0</span>, <span class="hljs-number">2.0</span>)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoPoint_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoPolygon_1
<div class="example-container" id="aqlGeoPolygon_1_container">
<a class="anchorjs-link " href="#aqlGeoPolygon_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoPolygon_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_POLYGON([
[<span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>], [<span class="hljs-number">7.5</span>, <span class="hljs-number">2.5</span>], [<span class="hljs-number">0.0</span>, <span class="hljs-number">5.0</span>]
])
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"Polygon"</span>,
<span class="hljs-string">"coordinates"</span>: [
[
[
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
],
[
<span class="hljs-number">7.5</span>,
<span class="hljs-number">2.5</span>
],
[
<span class="hljs-number">0</span>,
<span class="hljs-number">5</span>
]
]
]
}
]</pre>
<div id="aqlGeoPolygon_1_container_collapse" onclick="$('#aqlGeoPolygon_1_long').hide(); $('#aqlGeoPolygon_1_short').show(); window.location.hash='aqlGeoPolygon_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoPolygon_1_short" onclick="$('#aqlGeoPolygon_1_short').hide(); $('#aqlGeoPolygon_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_POLYGON([
[<span class="hljs-number">0.0</span>, <span class="hljs-number">0.0</span>], [<span class="hljs-number">7.5</span>, <span class="hljs-number">2.5</span>], [<span class="hljs-number">0.0</span>, <span class="hljs-number">5.0</span>]
])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoPolygon_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoPolygon_2
<div class="example-container" id="aqlGeoPolygon_2_container">
<a class="anchorjs-link " href="#aqlGeoPolygon_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoPolygon_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_POLYGON([
[[<span class="hljs-number">35</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">45</span>], [<span class="hljs-number">15</span>, <span class="hljs-number">40</span>], [<span class="hljs-number">10</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">35</span>, <span class="hljs-number">10</span>]],
[[<span class="hljs-number">20</span>, <span class="hljs-number">30</span>], [<span class="hljs-number">35</span>, <span class="hljs-number">35</span>], [<span class="hljs-number">30</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">30</span>]]
])
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"Polygon"</span>,
<span class="hljs-string">"coordinates"</span>: [
[
[
<span class="hljs-number">35</span>,
<span class="hljs-number">10</span>
],
[
<span class="hljs-number">45</span>,
<span class="hljs-number">45</span>
],
[
<span class="hljs-number">15</span>,
<span class="hljs-number">40</span>
],
[
<span class="hljs-number">10</span>,
<span class="hljs-number">20</span>
],
[
<span class="hljs-number">35</span>,
<span class="hljs-number">10</span>
]
],
[
[
<span class="hljs-number">20</span>,
<span class="hljs-number">30</span>
],
[
<span class="hljs-number">35</span>,
<span class="hljs-number">35</span>
],
[
<span class="hljs-number">30</span>,
<span class="hljs-number">20</span>
],
[
<span class="hljs-number">20</span>,
<span class="hljs-number">30</span>
]
]
]
}
]</pre>
<div id="aqlGeoPolygon_2_container_collapse" onclick="$('#aqlGeoPolygon_2_long').hide(); $('#aqlGeoPolygon_2_short').show(); window.location.hash='aqlGeoPolygon_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoPolygon_2_short" onclick="$('#aqlGeoPolygon_2_short').hide(); $('#aqlGeoPolygon_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_POLYGON([
[[<span class="hljs-number">35</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">45</span>], [<span class="hljs-number">15</span>, <span class="hljs-number">40</span>], [<span class="hljs-number">10</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">35</span>, <span class="hljs-number">10</span>]],
[[<span class="hljs-number">20</span>, <span class="hljs-number">30</span>], [<span class="hljs-number">35</span>, <span class="hljs-number">35</span>], [<span class="hljs-number">30</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">30</span>]]
])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoPolygon_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-geo.md -->
@startDocuBlockInline aqlGeoMultiPolygon_1
<div class="example-container" id="aqlGeoMultiPolygon_1_container">
<a class="anchorjs-link " href="#aqlGeoMultiPolygon_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlGeoMultiPolygon_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN GEO_MULTIPOLYGON([
[
[[<span class="hljs-number">40</span>, <span class="hljs-number">40</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">45</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">30</span>], [<span class="hljs-number">40</span>, <span class="hljs-number">40</span>]]
],
[
[[<span class="hljs-number">20</span>, <span class="hljs-number">35</span>], [<span class="hljs-number">10</span>, <span class="hljs-number">30</span>], [<span class="hljs-number">10</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">30</span>, <span class="hljs-number">5</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">35</span>]],
[[<span class="hljs-number">30</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">15</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">25</span>], [<span class="hljs-number">30</span>, <span class="hljs-number">20</span>]]
]
])
</pre>
<strong>Query results:</strong>
<pre>
[
{
<span class="hljs-string">"type"</span>: <span class="hljs-string">"MultiPolygon"</span>,
<span class="hljs-string">"coordinates"</span>: [
[
[
[
<span class="hljs-number">40</span>,
<span class="hljs-number">40</span>
],
[
<span class="hljs-number">20</span>,
<span class="hljs-number">45</span>
],
[
<span class="hljs-number">45</span>,
<span class="hljs-number">30</span>
],
[
<span class="hljs-number">40</span>,
<span class="hljs-number">40</span>
]
]
],
[
[
[
<span class="hljs-number">20</span>,
<span class="hljs-number">35</span>
],
[
<span class="hljs-number">10</span>,
<span class="hljs-number">30</span>
],
[
<span class="hljs-number">10</span>,
<span class="hljs-number">10</span>
],
[
<span class="hljs-number">30</span>,
<span class="hljs-number">5</span>
],
[
<span class="hljs-number">45</span>,
<span class="hljs-number">20</span>
],
[
<span class="hljs-number">20</span>,
<span class="hljs-number">35</span>
]
],
[
[
<span class="hljs-number">30</span>,
<span class="hljs-number">20</span>
],
[
<span class="hljs-number">20</span>,
<span class="hljs-number">15</span>
],
[
<span class="hljs-number">20</span>,
<span class="hljs-number">25</span>
],
[
<span class="hljs-number">30</span>,
<span class="hljs-number">20</span>
]
]
]
]
}
]</pre>
<div id="aqlGeoMultiPolygon_1_container_collapse" onclick="$('#aqlGeoMultiPolygon_1_long').hide(); $('#aqlGeoMultiPolygon_1_short').show(); window.location.hash='aqlGeoMultiPolygon_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlGeoMultiPolygon_1_short" onclick="$('#aqlGeoMultiPolygon_1_short').hide(); $('#aqlGeoMultiPolygon_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN GEO_MULTIPOLYGON([
[
[[<span class="hljs-number">40</span>, <span class="hljs-number">40</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">45</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">30</span>], [<span class="hljs-number">40</span>, <span class="hljs-number">40</span>]]
],
[
[[<span class="hljs-number">20</span>, <span class="hljs-number">35</span>], [<span class="hljs-number">10</span>, <span class="hljs-number">30</span>], [<span class="hljs-number">10</span>, <span class="hljs-number">10</span>], [<span class="hljs-number">30</span>, <span class="hljs-number">5</span>], [<span class="hljs-number">45</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">35</span>]],
[[<span class="hljs-number">30</span>, <span class="hljs-number">20</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">15</span>], [<span class="hljs-number">20</span>, <span class="hljs-number">25</span>], [<span class="hljs-number">30</span>, <span class="hljs-number">20</span>]]
]
])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlGeoMultiPolygon_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-query-profiler.md -->
@startDocuBlockInline 01_workWithAQL_profileQuerySimple
<div class="example-container" id="01_workWithAQL_profileQuerySimple_container">
<a class="anchorjs-link " href="#01_workWithAQL_profileQuerySimple_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="01_workWithAQL_profileQuerySimple_long" style="Display: none;">
<pre>
arangosh&gt; db._profileQuery(`
........&gt; FOR doc IN acollection
........&gt; FILTER doc.value &lt; 10
........&gt; RETURN doc`, {}, {colors: false}
........&gt; );
Query String (58 chars, cacheable: false):
FOR doc IN acollection
FILTER doc.value &lt; 10
RETURN doc
Execution plan:
Id NodeType Calls Items Runtime [s] Comment
1 SingletonNode 1 1 0.00000 * ROOT
2 EnumerateCollectionNode 10 10000 0.00418 - FOR doc IN acollection /* full collection scan */
3 CalculationNode 10 10000 0.00256 - LET #1 = (doc.`value` &lt; 10) /* simple expression */ /* collections used: doc : acollection */
4 FilterNode 1 10 0.00136 - FILTER #1
5 ReturnNode 1 10 0.00000 - RETURN doc
Indexes used:
none
Optimization rules applied:
none
Query Statistics:
Writes Exec Writes Ign Scan Full Scan Index Filtered Exec Time [s]
0 0 10000 0 9990 0.00868
Query Profile:
Query Stage Duration [s]
initializing 0.00000
parsing 0.00007
optimizing ast 0.00001
loading collections 0.00001
instantiating plan 0.00002
optimizing plan 0.00019
executing 0.00814
finalizing 0.00022
</pre>
<div id="01_workWithAQL_profileQuerySimple_container_collapse" onclick="$('#01_workWithAQL_profileQuerySimple_long').hide(); $('#01_workWithAQL_profileQuerySimple_short').show(); window.location.hash='01_workWithAQL_profileQuerySimple_container';" class="example_show_button">Hide execution results</div></div>
<div id="01_workWithAQL_profileQuerySimple_short" onclick="$('#01_workWithAQL_profileQuerySimple_short').hide(); $('#01_workWithAQL_profileQuerySimple_long').show();">
<pre>
arangosh&gt; db._profileQuery(`
........&gt; FOR doc IN acollection
........&gt; FILTER doc.value &lt; 10
........&gt; RETURN doc`, {}, {colors: false}
........&gt; );
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 01_workWithAQL_profileQuerySimple
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-query-profiler.md -->
@startDocuBlockInline 02_workWithAQL_profileQuerySimpleIndex
<div class="example-container" id="02_workWithAQL_profileQuerySimpleIndex_container">
<a class="anchorjs-link " href="#02_workWithAQL_profileQuerySimpleIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="02_workWithAQL_profileQuerySimpleIndex_long" style="Display: none;">
<pre>
arangosh&gt; db._profileQuery(<span class="hljs-string">`
........&gt; FOR doc IN acollection
........&gt; FILTER doc.value &lt; 10
........&gt; RETURN doc`</span>, {}, {<span class="hljs-attr">colors</span>: <span class="hljs-literal">false</span>}
........&gt; );
Query <span class="hljs-built_in">String</span> (<span class="hljs-number">58</span> chars, <span class="hljs-attr">cacheable</span>: <span class="hljs-literal">false</span>):
FOR doc IN acollection
FILTER doc.value &lt; <span class="hljs-number">10</span>
RETURN doc
Execution plan:
Id NodeType Calls Items Runtime [s] Comment
<span class="hljs-number">1</span> SingletonNode <span class="hljs-number">1</span> <span class="hljs-number">1</span> <span class="hljs-number">0.00000</span> * ROOT
<span class="hljs-number">6</span> IndexNode <span class="hljs-number">1</span> <span class="hljs-number">10</span> <span class="hljs-number">0.00009</span> - FOR doc IN acollection <span class="hljs-comment">/* skiplist index scan */</span>
<span class="hljs-number">5</span> ReturnNode <span class="hljs-number">1</span> <span class="hljs-number">10</span> <span class="hljs-number">0.00000</span> - RETURN doc
Indexes used:
By Name Type Collection Unique Sparse Selectivity Fields Ranges
<span class="hljs-number">6</span> idx_1646382028474548226 skiplist acollection <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-number">100.00</span> % [ <span class="hljs-string">`value`</span> ] (doc.<span class="hljs-string">`value`</span> &lt; <span class="hljs-number">10</span>)
Optimization rules applied:
Id RuleName
<span class="hljs-number">1</span> use-indexes
<span class="hljs-number">2</span> remove-filter-covered-by-index
<span class="hljs-number">3</span> remove-unnecessary-calculations<span class="hljs-number">-2</span>
Query Statistics:
Writes Exec Writes Ign Scan Full Scan Index Filtered Exec Time [s]
<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">10</span> <span class="hljs-number">0</span> <span class="hljs-number">0.00037</span>
Query Profile:
Query Stage Duration [s]
initializing <span class="hljs-number">0.00000</span>
parsing <span class="hljs-number">0.00004</span>
optimizing ast <span class="hljs-number">0.00000</span>
loading collections <span class="hljs-number">0.00001</span>
instantiating plan <span class="hljs-number">0.00001</span>
optimizing plan <span class="hljs-number">0.00010</span>
executing <span class="hljs-number">0.00011</span>
finalizing <span class="hljs-number">0.00007</span>
</pre>
<div id="02_workWithAQL_profileQuerySimpleIndex_container_collapse" onclick="$('#02_workWithAQL_profileQuerySimpleIndex_long').hide(); $('#02_workWithAQL_profileQuerySimpleIndex_short').show(); window.location.hash='02_workWithAQL_profileQuerySimpleIndex_container';" class="example_show_button">Hide execution results</div></div>
<div id="02_workWithAQL_profileQuerySimpleIndex_short" onclick="$('#02_workWithAQL_profileQuerySimpleIndex_short').hide(); $('#02_workWithAQL_profileQuerySimpleIndex_long').show();">
<pre>
arangosh&gt; db._profileQuery(<span class="hljs-string">`
........&gt; FOR doc IN acollection
........&gt; FILTER doc.value &lt; 10
........&gt; RETURN doc`</span>, {}, {<span class="hljs-attr">colors</span>: <span class="hljs-literal">false</span>}
........&gt; );
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 02_workWithAQL_profileQuerySimpleIndex
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-query-profiler.md -->
@startDocuBlockInline 03_workWithAQL_profileQuerySubquery
<div class="example-container" id="03_workWithAQL_profileQuerySubquery_container">
<a class="anchorjs-link " href="#03_workWithAQL_profileQuerySubquery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="03_workWithAQL_profileQuerySubquery_long" style="Display: none;">
<pre>
arangosh&gt; db._profileQuery(`
........&gt; LET list = (FOR doc in acollection FILTER doc.value &gt; 90 RETURN doc)
........&gt; FOR a IN list
........&gt; FILTER a.value &lt; 91
........&gt; RETURN a`, {}, {colors: false, optimizer:{rules:["-all"]}}
........&gt; );
Query String (116 chars, cacheable: false):
LET list = (FOR doc in acollection FILTER doc.value &gt; 90 RETURN doc)
FOR a IN list
FILTER a.value &lt; 91
RETURN a
Execution plan:
Id NodeType Calls Items Runtime [s] Comment
1 SingletonNode 1 1 0.00000 * ROOT
7 SubqueryNode 1 1 0.01107 - LET list = ... /* const subquery */
2 SingletonNode 1 1 0.00000 * ROOT
3 EnumerateCollectionNode 10 10000 0.00330 - FOR doc IN acollection /* full collection scan */
4 CalculationNode 10 10000 0.00257 - LET #5 = (doc.`value` &gt; 90) /* simple expression */ /* collections used: doc : acollection */
5 FilterNode 10 9909 0.00307 - FILTER #5
6 ReturnNode 10 9909 0.00210 - RETURN doc
8 EnumerateListNode 10 9909 0.00182 - FOR a IN list /* list iteration */
9 CalculationNode 10 9909 0.00254 - LET #7 = (a.`value` &lt; 91) /* simple expression */
10 FilterNode 1 0 0.00135 - FILTER #7
11 ReturnNode 1 0 0.00000 - RETURN a
Indexes used:
none
Optimization rules applied:
none
Query Statistics:
Writes Exec Writes Ign Scan Full Scan Index Filtered Exec Time [s]
0 0 10000 0 10000 0.01873
Query Profile:
Query Stage Duration [s]
initializing 0.00001
parsing 0.00005
optimizing ast 0.00001
loading collections 0.00001
instantiating plan 0.00002
optimizing plan 0.00011
executing 0.01679
finalizing 0.00171
</pre>
<div id="03_workWithAQL_profileQuerySubquery_container_collapse" onclick="$('#03_workWithAQL_profileQuerySubquery_long').hide(); $('#03_workWithAQL_profileQuerySubquery_short').show(); window.location.hash='03_workWithAQL_profileQuerySubquery_container';" class="example_show_button">Hide execution results</div></div>
<div id="03_workWithAQL_profileQuerySubquery_short" onclick="$('#03_workWithAQL_profileQuerySubquery_short').hide(); $('#03_workWithAQL_profileQuerySubquery_long').show();">
<pre>
arangosh&gt; db._profileQuery(`
........&gt; LET list = (FOR doc in acollection FILTER doc.value &gt; 90 RETURN doc)
........&gt; FOR a IN list
........&gt; FILTER a.value &lt; 91
........&gt; RETURN a`, {}, {colors: false, optimizer:{rules:["-all"]}}
........&gt; );
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 03_workWithAQL_profileQuerySubquery
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/execution-and-performance-query-profiler.md -->
@startDocuBlockInline 04_workWithAQL_profileQueryAggregation
<div class="example-container" id="04_workWithAQL_profileQueryAggregation_container">
<a class="anchorjs-link " href="#04_workWithAQL_profileQueryAggregation_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="04_workWithAQL_profileQueryAggregation_long" style="Display: none;">
<pre>
arangosh&gt; db._profileQuery(`
........&gt; FOR u IN myusers
........&gt; COLLECT ageGroup = FLOOR(u.age / 10) * 10
........&gt; AGGREGATE minAge = MIN(u.age), maxAge = MAX(u.age), len = LENGTH(u)
........&gt; RETURN {
........&gt; ageGroup,
........&gt; minAge,
........&gt; maxAge,
........&gt; len
........&gt; }`, {}, {colors: false}
........&gt; );
Query String (186 chars, cacheable: false):
FOR u IN myusers
COLLECT ageGroup = FLOOR(u.age / 10) * 10
AGGREGATE minAge = MIN(u.age), maxAge = MAX(u.age), len = LENGTH(u)
RETURN {
ageGroup,
minAge,
maxAge,
len
}
Execution plan:
Id NodeType Calls Items Runtime [s] Comment
1 SingletonNode 1 1 0.00000 * ROOT
2 EnumerateCollectionNode 1 20 0.00002 - FOR u IN myusers /* full collection scan */
3 CalculationNode 1 20 0.00002 - LET #5 = (FLOOR((u.`age` / 10)) * 10) /* simple expression */ /* collections used: u : myusers */
4 CalculationNode 1 20 0.00001 - LET #7 = u.`age` /* attribute expression */ /* collections used: u : myusers */
6 CollectNode 1 6 0.00002 - COLLECT ageGroup = #5 AGGREGATE minAge = MIN(#7), maxAge = MAX(#7), len = LENGTH(u) /* hash */
9 SortNode 1 6 0.00001 - SORT ageGroup ASC /* sorting strategy: standard */
7 CalculationNode 1 6 0.00001 - LET #11 = { "ageGroup" : ageGroup, "minAge" : minAge, "maxAge" : maxAge, "len" : len } /* simple expression */
8 ReturnNode 1 6 0.00000 - RETURN #11
Indexes used:
none
Optimization rules applied:
Id RuleName
1 move-calculations-up
2 remove-redundant-calculations
3 remove-unnecessary-calculations
4 move-calculations-up-2
5 move-calculations-down
Query Statistics:
Writes Exec Writes Ign Scan Full Scan Index Filtered Exec Time [s]
0 0 20 0 0 0.00056
Query Profile:
Query Stage Duration [s]
initializing 0.00000
parsing 0.00007
optimizing ast 0.00001
loading collections 0.00001
instantiating plan 0.00002
optimizing plan 0.00023
executing 0.00010
finalizing 0.00012
</pre>
<div id="04_workWithAQL_profileQueryAggregation_container_collapse" onclick="$('#04_workWithAQL_profileQueryAggregation_long').hide(); $('#04_workWithAQL_profileQueryAggregation_short').show(); window.location.hash='04_workWithAQL_profileQueryAggregation_container';" class="example_show_button">Hide execution results</div></div>
<div id="04_workWithAQL_profileQueryAggregation_short" onclick="$('#04_workWithAQL_profileQueryAggregation_short').hide(); $('#04_workWithAQL_profileQueryAggregation_long').show();">
<pre>
arangosh&gt; db._profileQuery(`
........&gt; FOR u IN myusers
........&gt; COLLECT ageGroup = FLOOR(u.age / 10) * 10
........&gt; AGGREGATE minAge = MIN(u.age), maxAge = MAX(u.age), len = LENGTH(u)
........&gt; RETURN {
........&gt; ageGroup,
........&gt; minAge,
........&gt; maxAge,
........&gt; len
........&gt; }`, {}, {colors: false}
........&gt; );
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock 04_workWithAQL_profileQueryAggregation
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-remove-vertex.md -->
@startDocuBlockInline GRAPHTRAV_removeVertex1
<div class="example-container" id="GRAPHTRAV_removeVertex1_container">
<a class="anchorjs-link " href="#GRAPHTRAV_removeVertex1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_removeVertex1_long">
<strong>Query:</strong>
<pre>
LET edgeKeys = (FOR v, e IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> ANY <span class="hljs-string">'persons/eve'</span> GRAPH <span class="hljs-string">'knows_graph'</span> RETURN e._key)
LET r = (FOR key IN edgeKeys REMOVE key IN knows)
REMOVE <span class="hljs-string">'eve'</span> IN persons
</pre>
<strong>Query results:</strong>
<pre>
[]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_removeVertex1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-remove-vertex.md -->
@startDocuBlockInline GRAPHTRAV_removeVertex2
<div class="example-container" id="GRAPHTRAV_removeVertex2_container">
<a class="anchorjs-link " href="#GRAPHTRAV_removeVertex2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_removeVertex2_long">
<strong>Query:</strong>
<pre>
LET edgeKeys = (FOR v, e IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> ANY <span class="hljs-string">'persons/eve'</span> GRAPH <span class="hljs-string">'knows_graph'</span>
REMOVE e._key IN knows)
REMOVE <span class="hljs-string">'eve'</span> IN persons
</pre>
<strong>Query results:</strong>
<pre>
[]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_removeVertex2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/examples-remove-vertex.md -->
@startDocuBlockInline GRAPHTRAV_removeVertex3
<div class="example-container" id="GRAPHTRAV_removeVertex3_container">
<a class="anchorjs-link " href="#GRAPHTRAV_removeVertex3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHTRAV_removeVertex3_long">
<strong>Query:</strong>
<pre>
LET edgeKeys = (FOR v, e IN <span class="hljs-number">1.</span><span class="hljs-number">.1</span> ANY <span class="hljs-string">'germanCity/Berlin'</span> GRAPH <span class="hljs-string">'routeplanner'</span> RETURN e._key)
LET r = (FOR key IN edgeKeys REMOVE key IN internationalHighway
OPTIONS { <span class="hljs-attr">ignoreErrors</span>: <span class="hljs-literal">true</span> } REMOVE key IN germanHighway
OPTIONS { <span class="hljs-attr">ignoreErrors</span>: <span class="hljs-literal">true</span> } REMOVE key IN frenchHighway
OPTIONS { <span class="hljs-attr">ignoreErrors</span>: <span class="hljs-literal">true</span> })
REMOVE <span class="hljs-string">'Berlin'</span> IN germanCity
</pre>
<strong>Query results:</strong>
<pre>
[]</pre>
</div>
</div>
@endDocuBlock GRAPHTRAV_removeVertex3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-shortest-path.md -->
@startDocuBlockInline GRAPHSP_01_create_graph
<div class="example-container" id="GRAPHSP_01_create_graph_container">
<a class="anchorjs-link " href="#GRAPHSP_01_create_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHSP_01_create_graph_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"traversalGraph"</span>);
arangosh&gt; db.circles.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"A"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/A"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v3y---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"B"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v32---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"2"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"C"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v32--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"D"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/D"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v32--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"4"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"E"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/E"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v32--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"F"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/F"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v36---"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"6"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"G"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v36--A"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"7"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"H"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/H"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v36--C"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"8"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"I"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/I"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v36--E"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"9"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"J"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/J"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v36--G"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"10"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"K"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"circles/K"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4----"</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"11"</span>
}
]
arangosh&gt; db.edges.toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66184"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66184"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4---A"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_bar"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66186"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66186"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4---C"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_blarg"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66188"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66188"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/C"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/D"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4---E"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_blorg"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66190"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66190"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/B"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/E"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4C---"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_blub"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66192"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66192"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/E"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/F"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4C--A"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"left_schubi"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66194"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66194"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/A"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4C--C"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_foo"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66196"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66196"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/H"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4C--E"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_blob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66198"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66198"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/H"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/I"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4G---"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_blub"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66200"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66200"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/G"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/J"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4G--A"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_zip"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"66202"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/66202"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"circles/J"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"circles/K"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5v4G--C"</span>,
<span class="hljs-string">"theFalse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"theTruth"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"label"</span> : <span class="hljs-string">"right_zup"</span>
}
]
</pre>
<div id="GRAPHSP_01_create_graph_container_collapse" onclick="$('#GRAPHSP_01_create_graph_long').hide(); $('#GRAPHSP_01_create_graph_short').show(); window.location.hash='GRAPHSP_01_create_graph_container';" class="example_show_button">Hide execution results</div></div>
<div id="GRAPHSP_01_create_graph_short" onclick="$('#GRAPHSP_01_create_graph_short').hide(); $('#GRAPHSP_01_create_graph_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; <span class="hljs-keyword">var</span> graph = examples.loadGraph(<span class="hljs-string">"traversalGraph"</span>);
arangosh&gt; db.circles.toArray();
arangosh&gt; db.edges.toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock GRAPHSP_01_create_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-shortest-path.md -->
@startDocuBlockInline GRAPHSP_02_A_to_D
<div class="example-container" id="GRAPHSP_02_A_to_D_container">
<a class="anchorjs-link " href="#GRAPHSP_02_A_to_D_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHSP_02_A_to_D_long" style="Display: none;">
<pre>
arangosh&gt; db._query(<span class="hljs-string">"FOR v, e IN OUTBOUND SHORTEST_PATH 'circles/A' TO 'circles/D' GRAPH 'traversalGraph' RETURN [v._key, e._key]"</span>);
[
[
<span class="hljs-string">"A"</span>,
<span class="hljs-literal">null</span>
],
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"66184"</span>
],
[
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"66186"</span>
],
[
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"66188"</span>
]
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">4</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
arangosh&gt; db._query(<span class="hljs-string">"FOR v, e IN OUTBOUND SHORTEST_PATH 'circles/A' TO 'circles/D' edges RETURN [v._key, e._key]"</span>);
[
[
<span class="hljs-string">"A"</span>,
<span class="hljs-literal">null</span>
],
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"66184"</span>
],
[
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"66186"</span>
],
[
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"66188"</span>
]
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">4</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="GRAPHSP_02_A_to_D_container_collapse" onclick="$('#GRAPHSP_02_A_to_D_long').hide(); $('#GRAPHSP_02_A_to_D_short').show(); window.location.hash='GRAPHSP_02_A_to_D_container';" class="example_show_button">Hide execution results</div></div>
<div id="GRAPHSP_02_A_to_D_short" onclick="$('#GRAPHSP_02_A_to_D_short').hide(); $('#GRAPHSP_02_A_to_D_long').show();">
<pre>
arangosh&gt; db._query(<span class="hljs-string">"FOR v, e IN OUTBOUND SHORTEST_PATH 'circles/A' TO 'circles/D' GRAPH 'traversalGraph' RETURN [v._key, e._key]"</span>);
arangosh&gt; db._query(<span class="hljs-string">"FOR v, e IN OUTBOUND SHORTEST_PATH 'circles/A' TO 'circles/D' edges RETURN [v._key, e._key]"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock GRAPHSP_02_A_to_D
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-shortest-path.md -->
@startDocuBlockInline GRAPHSP_03_A_to_D
<div class="example-container" id="GRAPHSP_03_A_to_D_container">
<a class="anchorjs-link " href="#GRAPHSP_03_A_to_D_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHSP_03_A_to_D_long" style="Display: none;">
<pre>
arangosh&gt; db._query(<span class="hljs-string">"FOR a IN circles FILTER a._key == 'A' FOR d IN circles FILTER d._key == 'D' FOR v, e IN OUTBOUND SHORTEST_PATH a TO d GRAPH 'traversalGraph' RETURN [v._key, e._key]"</span>);
[
[
<span class="hljs-string">"A"</span>,
<span class="hljs-literal">null</span>
],
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"66184"</span>
],
[
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"66186"</span>
],
[
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"66188"</span>
]
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">4</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
arangosh&gt; db._query(<span class="hljs-string">"FOR a IN circles FILTER a._key == 'A' FOR d IN circles FILTER d._key == 'D' FOR v, e IN OUTBOUND SHORTEST_PATH a TO d edges RETURN [v._key, e._key]"</span>);
[
[
<span class="hljs-string">"A"</span>,
<span class="hljs-literal">null</span>
],
[
<span class="hljs-string">"B"</span>,
<span class="hljs-string">"66184"</span>
],
[
<span class="hljs-string">"C"</span>,
<span class="hljs-string">"66186"</span>
],
[
<span class="hljs-string">"D"</span>,
<span class="hljs-string">"66188"</span>
]
]
[object ArangoQueryCursor, <span class="hljs-attr">count</span>: <span class="hljs-number">4</span>, <span class="hljs-attr">cached</span>: <span class="hljs-literal">false</span>, <span class="hljs-attr">hasMore</span>: <span class="hljs-literal">false</span>]
</pre>
<div id="GRAPHSP_03_A_to_D_container_collapse" onclick="$('#GRAPHSP_03_A_to_D_long').hide(); $('#GRAPHSP_03_A_to_D_short').show(); window.location.hash='GRAPHSP_03_A_to_D_container';" class="example_show_button">Hide execution results</div></div>
<div id="GRAPHSP_03_A_to_D_short" onclick="$('#GRAPHSP_03_A_to_D_short').hide(); $('#GRAPHSP_03_A_to_D_long').show();">
<pre>
arangosh&gt; db._query(<span class="hljs-string">"FOR a IN circles FILTER a._key == 'A' FOR d IN circles FILTER d._key == 'D' FOR v, e IN OUTBOUND SHORTEST_PATH a TO d GRAPH 'traversalGraph' RETURN [v._key, e._key]"</span>);
arangosh&gt; db._query(<span class="hljs-string">"FOR a IN circles FILTER a._key == 'A' FOR d IN circles FILTER d._key == 'D' FOR v, e IN OUTBOUND SHORTEST_PATH a TO d edges RETURN [v._key, e._key]"</span>);
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock GRAPHSP_03_A_to_D
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/graphs-shortest-path.md -->
@startDocuBlockInline GRAPHSP_99_drop_graph
<div class="example-container" id="GRAPHSP_99_drop_graph_container">
<a class="anchorjs-link " href="#GRAPHSP_99_drop_graph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="GRAPHSP_99_drop_graph_long">
<pre>
arangosh&gt; <span class="hljs-keyword">var</span> examples = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@arangodb/graph-examples/example-graph.js"</span>);
arangosh&gt; examples.dropGraph(<span class="hljs-string">"traversalGraph"</span>);
</pre>
</div>
</div>
@endDocuBlock GRAPHSP_99_drop_graph
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayAppend_1
<div class="example-container" id="aqlArrayAppend_1_container">
<a class="anchorjs-link " href="#aqlArrayAppend_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayAppend_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN APPEND([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], [ <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">9</span> ])
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">5</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">9</span>
]
]</pre>
<div id="aqlArrayAppend_1_container_collapse" onclick="$('#aqlArrayAppend_1_long').hide(); $('#aqlArrayAppend_1_short').show(); window.location.hash='aqlArrayAppend_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayAppend_1_short" onclick="$('#aqlArrayAppend_1_short').hide(); $('#aqlArrayAppend_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN APPEND([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], [ <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">9</span> ])
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayAppend_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayAppend_2
<div class="example-container" id="aqlArrayAppend_2_container">
<a class="anchorjs-link " href="#aqlArrayAppend_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayAppend_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN APPEND([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">2</span>, <span class="hljs-number">9</span> ], <span class="hljs-literal">true</span>)
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">5</span>,
<span class="hljs-number">9</span>
]
]</pre>
<div id="aqlArrayAppend_2_container_collapse" onclick="$('#aqlArrayAppend_2_long').hide(); $('#aqlArrayAppend_2_short').show(); window.location.hash='aqlArrayAppend_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayAppend_2_short" onclick="$('#aqlArrayAppend_2_short').hide(); $('#aqlArrayAppend_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN APPEND([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">2</span>, <span class="hljs-number">9</span> ], <span class="hljs-literal">true</span>)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayAppend_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayCountDistinct_1
<div class="example-container" id="aqlArrayCountDistinct_1_container">
<a class="anchorjs-link " href="#aqlArrayCountDistinct_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayCountDistinct_1_long">
<strong>Query:</strong>
<pre>
RETURN COUNT_DISTINCT([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ])
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">3</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayCountDistinct_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayCountDistinct_2
<div class="example-container" id="aqlArrayCountDistinct_2_container">
<a class="anchorjs-link " href="#aqlArrayCountDistinct_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayCountDistinct_2_long">
<strong>Query:</strong>
<pre>
RETURN COUNT_DISTINCT([ <span class="hljs-string">"yes"</span>, <span class="hljs-string">"no"</span>, <span class="hljs-string">"yes"</span>, <span class="hljs-string">"sauron"</span>, <span class="hljs-string">"no"</span>, <span class="hljs-string">"yes"</span> ])
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">3</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayCountDistinct_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayFirst_1
<div class="example-container" id="aqlArrayFirst_1_container">
<a class="anchorjs-link " href="#aqlArrayFirst_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayFirst_1_long">
<strong>Query:</strong>
<pre>
RETURN FIRST([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ])
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">1</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayFirst_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayFirst_2
<div class="example-container" id="aqlArrayFirst_2_container">
<a class="anchorjs-link " href="#aqlArrayFirst_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayFirst_2_long">
<strong>Query:</strong>
<pre>
RETURN FIRST([])
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-literal">null</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayFirst_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayFlatten_1
<div class="example-container" id="aqlArrayFlatten_1_container">
<a class="anchorjs-link " href="#aqlArrayFlatten_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayFlatten_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN FLATTEN( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], <span class="hljs-number">5</span>, [ <span class="hljs-number">6</span>, <span class="hljs-number">7</span> ], [ <span class="hljs-number">8</span>, [ <span class="hljs-number">9</span>, <span class="hljs-number">10</span> ] ] ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">5</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">7</span>,
<span class="hljs-number">8</span>,
[
<span class="hljs-number">9</span>,
<span class="hljs-number">10</span>
]
]
]</pre>
<div id="aqlArrayFlatten_1_container_collapse" onclick="$('#aqlArrayFlatten_1_long').hide(); $('#aqlArrayFlatten_1_short').show(); window.location.hash='aqlArrayFlatten_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayFlatten_1_short" onclick="$('#aqlArrayFlatten_1_short').hide(); $('#aqlArrayFlatten_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN FLATTEN( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], <span class="hljs-number">5</span>, [ <span class="hljs-number">6</span>, <span class="hljs-number">7</span> ], [ <span class="hljs-number">8</span>, [ <span class="hljs-number">9</span>, <span class="hljs-number">10</span> ] ] ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayFlatten_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayFlatten_2
<div class="example-container" id="aqlArrayFlatten_2_container">
<a class="anchorjs-link " href="#aqlArrayFlatten_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayFlatten_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN FLATTEN( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], <span class="hljs-number">5</span>, [ <span class="hljs-number">6</span>, <span class="hljs-number">7</span> ], [ <span class="hljs-number">8</span>, [ <span class="hljs-number">9</span>, <span class="hljs-number">10</span> ] ] ], <span class="hljs-number">2</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">5</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">7</span>,
<span class="hljs-number">8</span>,
<span class="hljs-number">9</span>,
<span class="hljs-number">10</span>
]
]</pre>
<div id="aqlArrayFlatten_2_container_collapse" onclick="$('#aqlArrayFlatten_2_long').hide(); $('#aqlArrayFlatten_2_short').show(); window.location.hash='aqlArrayFlatten_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayFlatten_2_short" onclick="$('#aqlArrayFlatten_2_short').hide(); $('#aqlArrayFlatten_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN FLATTEN( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], <span class="hljs-number">5</span>, [ <span class="hljs-number">6</span>, <span class="hljs-number">7</span> ], [ <span class="hljs-number">8</span>, [ <span class="hljs-number">9</span>, <span class="hljs-number">10</span> ] ] ], <span class="hljs-number">2</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayFlatten_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayIntersection_1
<div class="example-container" id="aqlArrayIntersection_1_container">
<a class="anchorjs-link " href="#aqlArrayIntersection_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayIntersection_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN INTERSECTION( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>], [<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>], [<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">5</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArrayIntersection_1_container_collapse" onclick="$('#aqlArrayIntersection_1_long').hide(); $('#aqlArrayIntersection_1_short').show(); window.location.hash='aqlArrayIntersection_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayIntersection_1_short" onclick="$('#aqlArrayIntersection_1_short').hide(); $('#aqlArrayIntersection_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN INTERSECTION( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>], [<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>], [<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayIntersection_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayIntersection_2
<div class="example-container" id="aqlArrayIntersection_2_container">
<a class="anchorjs-link " href="#aqlArrayIntersection_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayIntersection_2_long">
<strong>Query:</strong>
<pre>
RETURN INTERSECTION( [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>], [<span class="hljs-number">8</span>,<span class="hljs-number">10</span>,<span class="hljs-number">12</span>], [<span class="hljs-number">14</span>,<span class="hljs-number">16</span>,<span class="hljs-number">18</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
[]
]</pre>
</div>
</div>
@endDocuBlock aqlArrayIntersection_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayLast_1
<div class="example-container" id="aqlArrayLast_1_container">
<a class="anchorjs-link " href="#aqlArrayLast_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayLast_1_long">
<strong>Query:</strong>
<pre>
RETURN LAST( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">5</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayLast_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayLength_1
<div class="example-container" id="aqlArrayLength_1_container">
<a class="anchorjs-link " href="#aqlArrayLength_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayLength_1_long">
<strong>Query:</strong>
<pre>
RETURN LENGTH( <span class="hljs-string">"🥑"</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">1</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayLength_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayLength_2
<div class="example-container" id="aqlArrayLength_2_container">
<a class="anchorjs-link " href="#aqlArrayLength_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayLength_2_long">
<strong>Query:</strong>
<pre>
RETURN LENGTH( <span class="hljs-number">1234</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">4</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayLength_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayLength_3
<div class="example-container" id="aqlArrayLength_3_container">
<a class="anchorjs-link " href="#aqlArrayLength_3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayLength_3_long">
<strong>Query:</strong>
<pre>
RETURN LENGTH( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">7</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayLength_3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayLength_4
<div class="example-container" id="aqlArrayLength_4_container">
<a class="anchorjs-link " href="#aqlArrayLength_4_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayLength_4_long">
<strong>Query:</strong>
<pre>
RETURN LENGTH( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">7</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayLength_4
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayLength_5
<div class="example-container" id="aqlArrayLength_5_container">
<a class="anchorjs-link " href="#aqlArrayLength_5_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayLength_5_long">
<strong>Query:</strong>
<pre>
RETURN LENGTH( {<span class="hljs-attr">a</span>:<span class="hljs-number">1</span>, <span class="hljs-attr">b</span>:<span class="hljs-number">2</span>, <span class="hljs-attr">c</span>:<span class="hljs-number">3</span>, <span class="hljs-attr">d</span>:<span class="hljs-number">4</span>, <span class="hljs-attr">e</span>:{<span class="hljs-attr">f</span>:<span class="hljs-number">5</span>,<span class="hljs-attr">g</span>:<span class="hljs-number">6</span>}} )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">5</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayLength_5
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayMinus_1
<div class="example-container" id="aqlArrayMinus_1_container">
<a class="anchorjs-link " href="#aqlArrayMinus_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayMinus_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN MINUS( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>], [<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>], [<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>,<span class="hljs-number">8</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">2</span>,
<span class="hljs-number">1</span>
]
]</pre>
<div id="aqlArrayMinus_1_container_collapse" onclick="$('#aqlArrayMinus_1_long').hide(); $('#aqlArrayMinus_1_short').show(); window.location.hash='aqlArrayMinus_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayMinus_1_short" onclick="$('#aqlArrayMinus_1_short').hide(); $('#aqlArrayMinus_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN MINUS( [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>], [<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>], [<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>,<span class="hljs-number">8</span>] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayMinus_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayNth_1
<div class="example-container" id="aqlArrayNth_1_container">
<a class="anchorjs-link " href="#aqlArrayNth_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayNth_1_long">
<strong>Query:</strong>
<pre>
RETURN NTH( [ <span class="hljs-string">"foo"</span>, <span class="hljs-string">"bar"</span>, <span class="hljs-string">"baz"</span> ], <span class="hljs-number">2</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-string">"baz"</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayNth_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayNth_2
<div class="example-container" id="aqlArrayNth_2_container">
<a class="anchorjs-link " href="#aqlArrayNth_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayNth_2_long">
<strong>Query:</strong>
<pre>
RETURN NTH( [ <span class="hljs-string">"foo"</span>, <span class="hljs-string">"bar"</span>, <span class="hljs-string">"baz"</span> ], <span class="hljs-number">3</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-literal">null</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayNth_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayNth_3
<div class="example-container" id="aqlArrayNth_3_container">
<a class="anchorjs-link " href="#aqlArrayNth_3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayNth_3_long">
<strong>Query:</strong>
<pre>
RETURN NTH( [ <span class="hljs-string">"foo"</span>, <span class="hljs-string">"bar"</span>, <span class="hljs-string">"baz"</span> ], <span class="hljs-number">-1</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-literal">null</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayNth_3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayOutersection_1
<div class="example-container" id="aqlArrayOutersection_1_container">
<a class="anchorjs-link " href="#aqlArrayOutersection_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayOutersection_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN OUTERSECTION( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], [ <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">5</span>,
<span class="hljs-number">1</span>
]
]</pre>
<div id="aqlArrayOutersection_1_container_collapse" onclick="$('#aqlArrayOutersection_1_long').hide(); $('#aqlArrayOutersection_1_short').show(); window.location.hash='aqlArrayOutersection_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayOutersection_1_short" onclick="$('#aqlArrayOutersection_1_short').hide(); $('#aqlArrayOutersection_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN OUTERSECTION( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], [ <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], [ <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayOutersection_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayPop_1
<div class="example-container" id="aqlArrayPop_1_container">
<a class="anchorjs-link " href="#aqlArrayPop_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayPop_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN POP( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArrayPop_1_container_collapse" onclick="$('#aqlArrayPop_1_long').hide(); $('#aqlArrayPop_1_short').show(); window.location.hash='aqlArrayPop_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayPop_1_short" onclick="$('#aqlArrayPop_1_short').hide(); $('#aqlArrayPop_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN POP( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayPop_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayPop_2
<div class="example-container" id="aqlArrayPop_2_container">
<a class="anchorjs-link " href="#aqlArrayPop_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayPop_2_long">
<strong>Query:</strong>
<pre>
RETURN POP( [ <span class="hljs-number">1</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[]
]</pre>
</div>
</div>
@endDocuBlock aqlArrayPop_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayPosition_1
<div class="example-container" id="aqlArrayPosition_1_container">
<a class="anchorjs-link " href="#aqlArrayPosition_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayPosition_1_long">
<strong>Query:</strong>
<pre>
RETURN POSITION( [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">8</span>], <span class="hljs-number">4</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-literal">true</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayPosition_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayPosition_2
<div class="example-container" id="aqlArrayPosition_2_container">
<a class="anchorjs-link " href="#aqlArrayPosition_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayPosition_2_long">
<strong>Query:</strong>
<pre>
RETURN POSITION( [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">8</span>], <span class="hljs-number">4</span>, <span class="hljs-literal">true</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
<span class="hljs-number">1</span>
]</pre>
</div>
</div>
@endDocuBlock aqlArrayPosition_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayPush_1
<div class="example-container" id="aqlArrayPush_1_container">
<a class="anchorjs-link " href="#aqlArrayPush_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayPush_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN PUSH([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">4</span>)
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]
]</pre>
<div id="aqlArrayPush_1_container_collapse" onclick="$('#aqlArrayPush_1_long').hide(); $('#aqlArrayPush_1_short').show(); window.location.hash='aqlArrayPush_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayPush_1_short" onclick="$('#aqlArrayPush_1_short').hide(); $('#aqlArrayPush_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN PUSH([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">4</span>)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayPush_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayPush_2
<div class="example-container" id="aqlArrayPush_2_container">
<a class="anchorjs-link " href="#aqlArrayPush_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayPush_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN PUSH([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">2</span>, <span class="hljs-literal">true</span>)
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArrayPush_2_container_collapse" onclick="$('#aqlArrayPush_2_long').hide(); $('#aqlArrayPush_2_short').show(); window.location.hash='aqlArrayPush_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayPush_2_short" onclick="$('#aqlArrayPush_2_short').hide(); $('#aqlArrayPush_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN PUSH([ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">2</span>, <span class="hljs-literal">true</span>)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayPush_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayRemoveNth_1
<div class="example-container" id="aqlArrayRemoveNth_1_container">
<a class="anchorjs-link " href="#aqlArrayRemoveNth_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayRemoveNth_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN REMOVE_NTH( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>, <span class="hljs-string">"d"</span>, <span class="hljs-string">"e"</span> ], <span class="hljs-number">1</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"c"</span>,
<span class="hljs-string">"d"</span>,
<span class="hljs-string">"e"</span>
]
]</pre>
<div id="aqlArrayRemoveNth_1_container_collapse" onclick="$('#aqlArrayRemoveNth_1_long').hide(); $('#aqlArrayRemoveNth_1_short').show(); window.location.hash='aqlArrayRemoveNth_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayRemoveNth_1_short" onclick="$('#aqlArrayRemoveNth_1_short').hide(); $('#aqlArrayRemoveNth_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN REMOVE_NTH( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>, <span class="hljs-string">"d"</span>, <span class="hljs-string">"e"</span> ], <span class="hljs-number">1</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayRemoveNth_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayRemoveNth_2
<div class="example-container" id="aqlArrayRemoveNth_2_container">
<a class="anchorjs-link " href="#aqlArrayRemoveNth_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayRemoveNth_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN REMOVE_NTH( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>, <span class="hljs-string">"d"</span>, <span class="hljs-string">"e"</span> ], <span class="hljs-number">-2</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>,
<span class="hljs-string">"c"</span>,
<span class="hljs-string">"e"</span>
]
]</pre>
<div id="aqlArrayRemoveNth_2_container_collapse" onclick="$('#aqlArrayRemoveNth_2_long').hide(); $('#aqlArrayRemoveNth_2_short').show(); window.location.hash='aqlArrayRemoveNth_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayRemoveNth_2_short" onclick="$('#aqlArrayRemoveNth_2_short').hide(); $('#aqlArrayRemoveNth_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN REMOVE_NTH( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>, <span class="hljs-string">"d"</span>, <span class="hljs-string">"e"</span> ], <span class="hljs-number">-2</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayRemoveNth_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayRemoveValue_1
<div class="example-container" id="aqlArrayRemoveValue_1_container">
<a class="anchorjs-link " href="#aqlArrayRemoveValue_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayRemoveValue_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN REMOVE_VALUE( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"a"</span>, <span class="hljs-string">"c"</span> ], <span class="hljs-string">"a"</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-string">"b"</span>,
<span class="hljs-string">"b"</span>,
<span class="hljs-string">"c"</span>
]
]</pre>
<div id="aqlArrayRemoveValue_1_container_collapse" onclick="$('#aqlArrayRemoveValue_1_long').hide(); $('#aqlArrayRemoveValue_1_short').show(); window.location.hash='aqlArrayRemoveValue_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayRemoveValue_1_short" onclick="$('#aqlArrayRemoveValue_1_short').hide(); $('#aqlArrayRemoveValue_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN REMOVE_VALUE( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"a"</span>, <span class="hljs-string">"c"</span> ], <span class="hljs-string">"a"</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayRemoveValue_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayRemoveValue_2
<div class="example-container" id="aqlArrayRemoveValue_2_container">
<a class="anchorjs-link " href="#aqlArrayRemoveValue_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayRemoveValue_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN REMOVE_VALUE( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"a"</span>, <span class="hljs-string">"c"</span> ], <span class="hljs-string">"a"</span>, <span class="hljs-number">1</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-string">"b"</span>,
<span class="hljs-string">"b"</span>,
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"c"</span>
]
]</pre>
<div id="aqlArrayRemoveValue_2_container_collapse" onclick="$('#aqlArrayRemoveValue_2_long').hide(); $('#aqlArrayRemoveValue_2_short').show(); window.location.hash='aqlArrayRemoveValue_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayRemoveValue_2_short" onclick="$('#aqlArrayRemoveValue_2_short').hide(); $('#aqlArrayRemoveValue_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN REMOVE_VALUE( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"a"</span>, <span class="hljs-string">"c"</span> ], <span class="hljs-string">"a"</span>, <span class="hljs-number">1</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayRemoveValue_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayRemoveValues_1
<div class="example-container" id="aqlArrayRemoveValues_1_container">
<a class="anchorjs-link " href="#aqlArrayRemoveValues_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayRemoveValues_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN REMOVE_VALUES( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>, <span class="hljs-string">"d"</span>, <span class="hljs-string">"e"</span>, <span class="hljs-string">"f"</span> ], [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"f"</span>, <span class="hljs-string">"d"</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-string">"b"</span>,
<span class="hljs-string">"c"</span>,
<span class="hljs-string">"e"</span>
]
]</pre>
<div id="aqlArrayRemoveValues_1_container_collapse" onclick="$('#aqlArrayRemoveValues_1_long').hide(); $('#aqlArrayRemoveValues_1_short').show(); window.location.hash='aqlArrayRemoveValues_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayRemoveValues_1_short" onclick="$('#aqlArrayRemoveValues_1_short').hide(); $('#aqlArrayRemoveValues_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN REMOVE_VALUES( [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>, <span class="hljs-string">"d"</span>, <span class="hljs-string">"e"</span>, <span class="hljs-string">"f"</span> ], [ <span class="hljs-string">"a"</span>, <span class="hljs-string">"f"</span>, <span class="hljs-string">"d"</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayRemoveValues_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayReverse_1
<div class="example-container" id="aqlArrayReverse_1_container">
<a class="anchorjs-link " href="#aqlArrayReverse_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayReverse_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN REVERSE ( [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">8</span>,<span class="hljs-number">10</span>] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">10</span>,
<span class="hljs-number">8</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">2</span>
]
]</pre>
<div id="aqlArrayReverse_1_container_collapse" onclick="$('#aqlArrayReverse_1_long').hide(); $('#aqlArrayReverse_1_short').show(); window.location.hash='aqlArrayReverse_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayReverse_1_short" onclick="$('#aqlArrayReverse_1_short').hide(); $('#aqlArrayReverse_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN REVERSE ( [<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">8</span>,<span class="hljs-number">10</span>] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayReverse_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayShift_1
<div class="example-container" id="aqlArrayShift_1_container">
<a class="anchorjs-link " href="#aqlArrayShift_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayShift_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SHIFT( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]
]</pre>
<div id="aqlArrayShift_1_container_collapse" onclick="$('#aqlArrayShift_1_long').hide(); $('#aqlArrayShift_1_short').show(); window.location.hash='aqlArrayShift_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayShift_1_short" onclick="$('#aqlArrayShift_1_short').hide(); $('#aqlArrayShift_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN SHIFT( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayShift_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayShift_2
<div class="example-container" id="aqlArrayShift_2_container">
<a class="anchorjs-link " href="#aqlArrayShift_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayShift_2_long">
<strong>Query:</strong>
<pre>
RETURN SHIFT( [ <span class="hljs-number">1</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[]
]</pre>
</div>
</div>
@endDocuBlock aqlArrayShift_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySlice_1
<div class="example-container" id="aqlArraySlice_1_container">
<a class="anchorjs-link " href="#aqlArraySlice_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySlice_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">0</span>, <span class="hljs-number">1</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>
]
]</pre>
<div id="aqlArraySlice_1_container_collapse" onclick="$('#aqlArraySlice_1_long').hide(); $('#aqlArraySlice_1_short').show(); window.location.hash='aqlArraySlice_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySlice_1_short" onclick="$('#aqlArraySlice_1_short').hide(); $('#aqlArraySlice_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">0</span>, <span class="hljs-number">1</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySlice_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySlice_2
<div class="example-container" id="aqlArraySlice_2_container">
<a class="anchorjs-link " href="#aqlArraySlice_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySlice_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">1</span>, <span class="hljs-number">2</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArraySlice_2_container_collapse" onclick="$('#aqlArraySlice_2_long').hide(); $('#aqlArraySlice_2_short').show(); window.location.hash='aqlArraySlice_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySlice_2_short" onclick="$('#aqlArraySlice_2_short').hide(); $('#aqlArraySlice_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">1</span>, <span class="hljs-number">2</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySlice_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySlice_3
<div class="example-container" id="aqlArraySlice_3_container">
<a class="anchorjs-link " href="#aqlArraySlice_3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySlice_3_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">3</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">4</span>,
<span class="hljs-number">5</span>
]
]</pre>
<div id="aqlArraySlice_3_container_collapse" onclick="$('#aqlArraySlice_3_long').hide(); $('#aqlArraySlice_3_short').show(); window.location.hash='aqlArraySlice_3_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySlice_3_short" onclick="$('#aqlArraySlice_3_short').hide(); $('#aqlArraySlice_3_long').show();">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">3</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySlice_3
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySlice_4
<div class="example-container" id="aqlArraySlice_4_container">
<a class="anchorjs-link " href="#aqlArraySlice_4_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySlice_4_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">1</span>, <span class="hljs-number">-1</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]
]</pre>
<div id="aqlArraySlice_4_container_collapse" onclick="$('#aqlArraySlice_4_long').hide(); $('#aqlArraySlice_4_short').show(); window.location.hash='aqlArraySlice_4_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySlice_4_short" onclick="$('#aqlArraySlice_4_short').hide(); $('#aqlArraySlice_4_long').show();">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">1</span>, <span class="hljs-number">-1</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySlice_4
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySlice_5
<div class="example-container" id="aqlArraySlice_5_container">
<a class="anchorjs-link " href="#aqlArraySlice_5_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySlice_5_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">0</span>, <span class="hljs-number">-2</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArraySlice_5_container_collapse" onclick="$('#aqlArraySlice_5_long').hide(); $('#aqlArraySlice_5_short').show(); window.location.hash='aqlArraySlice_5_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySlice_5_short" onclick="$('#aqlArraySlice_5_short').hide(); $('#aqlArraySlice_5_long').show();">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">0</span>, <span class="hljs-number">-2</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySlice_5
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySlice_6
<div class="example-container" id="aqlArraySlice_6_container">
<a class="anchorjs-link " href="#aqlArraySlice_6_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySlice_6_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">-3</span>, <span class="hljs-number">2</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>
]
]</pre>
<div id="aqlArraySlice_6_container_collapse" onclick="$('#aqlArraySlice_6_long').hide(); $('#aqlArraySlice_6_short').show(); window.location.hash='aqlArraySlice_6_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySlice_6_short" onclick="$('#aqlArraySlice_6_short').hide(); $('#aqlArraySlice_6_long').show();">
<strong>Query:</strong>
<pre>
RETURN SLICE( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span> ], <span class="hljs-number">-3</span>, <span class="hljs-number">2</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySlice_6
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySorted_1
<div class="example-container" id="aqlArraySorted_1_container">
<a class="anchorjs-link " href="#aqlArraySorted_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySorted_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SORTED( [ <span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>,<span class="hljs-number">10</span>,<span class="hljs-number">6</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">2</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">8</span>,
<span class="hljs-number">10</span>
]
]</pre>
<div id="aqlArraySorted_1_container_collapse" onclick="$('#aqlArraySorted_1_long').hide(); $('#aqlArraySorted_1_short').show(); window.location.hash='aqlArraySorted_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySorted_1_short" onclick="$('#aqlArraySorted_1_short').hide(); $('#aqlArraySorted_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN SORTED( [ <span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>,<span class="hljs-number">10</span>,<span class="hljs-number">6</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySorted_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArraySortedUnique_1
<div class="example-container" id="aqlArraySortedUnique_1_container">
<a class="anchorjs-link " href="#aqlArraySortedUnique_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArraySortedUnique_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN SORTED_UNIQUE( [ <span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>,<span class="hljs-number">10</span>,<span class="hljs-number">6</span>,<span class="hljs-number">2</span>,<span class="hljs-number">8</span>,<span class="hljs-number">6</span>,<span class="hljs-number">4</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">2</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">8</span>,
<span class="hljs-number">10</span>
]
]</pre>
<div id="aqlArraySortedUnique_1_container_collapse" onclick="$('#aqlArraySortedUnique_1_long').hide(); $('#aqlArraySortedUnique_1_short').show(); window.location.hash='aqlArraySortedUnique_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArraySortedUnique_1_short" onclick="$('#aqlArraySortedUnique_1_short').hide(); $('#aqlArraySortedUnique_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN SORTED_UNIQUE( [ <span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>,<span class="hljs-number">10</span>,<span class="hljs-number">6</span>,<span class="hljs-number">2</span>,<span class="hljs-number">8</span>,<span class="hljs-number">6</span>,<span class="hljs-number">4</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArraySortedUnique_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayUnion_1
<div class="example-container" id="aqlArrayUnion_1_container">
<a class="anchorjs-link " href="#aqlArrayUnion_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayUnion_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN UNION(
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ],
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ]
)
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>
]
]</pre>
<div id="aqlArrayUnion_1_container_collapse" onclick="$('#aqlArrayUnion_1_long').hide(); $('#aqlArrayUnion_1_short').show(); window.location.hash='aqlArrayUnion_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayUnion_1_short" onclick="$('#aqlArrayUnion_1_short').hide(); $('#aqlArrayUnion_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN UNION(
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ],
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ]
)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayUnion_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayUnion_2
<div class="example-container" id="aqlArrayUnion_2_container">
<a class="anchorjs-link " href="#aqlArrayUnion_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayUnion_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN UNIQUE(
UNION(
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ],
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ]
)
)
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArrayUnion_2_container_collapse" onclick="$('#aqlArrayUnion_2_long').hide(); $('#aqlArrayUnion_2_short').show(); window.location.hash='aqlArrayUnion_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayUnion_2_short" onclick="$('#aqlArrayUnion_2_short').hide(); $('#aqlArrayUnion_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN UNIQUE(
UNION(
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ],
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ]
)
)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayUnion_2
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayUnionDistinct_1
<div class="example-container" id="aqlArrayUnionDistinct_1_container">
<a class="anchorjs-link " href="#aqlArrayUnionDistinct_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayUnionDistinct_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN UNION_DISTINCT(
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ],
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ]
)
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">3</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">1</span>
]
]</pre>
<div id="aqlArrayUnionDistinct_1_container_collapse" onclick="$('#aqlArrayUnionDistinct_1_long').hide(); $('#aqlArrayUnionDistinct_1_short').show(); window.location.hash='aqlArrayUnionDistinct_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayUnionDistinct_1_short" onclick="$('#aqlArrayUnionDistinct_1_short').hide(); $('#aqlArrayUnionDistinct_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN UNION_DISTINCT(
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ],
[ <span class="hljs-number">1</span>, <span class="hljs-number">2</span> ]
)
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayUnionDistinct_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayUnique_1
<div class="example-container" id="aqlArrayUnique_1_container">
<a class="anchorjs-link " href="#aqlArrayUnique_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayUnique_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN UNIQUE( [ <span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">3</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">4</span>,<span class="hljs-number">4</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span> ] )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">5</span>
]
]</pre>
<div id="aqlArrayUnique_1_container_collapse" onclick="$('#aqlArrayUnique_1_long').hide(); $('#aqlArrayUnique_1_short').show(); window.location.hash='aqlArrayUnique_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayUnique_1_short" onclick="$('#aqlArrayUnique_1_short').hide(); $('#aqlArrayUnique_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN UNIQUE( [ <span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">3</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">4</span>,<span class="hljs-number">4</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span>,<span class="hljs-number">5</span> ] )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayUnique_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayUnshift_1
<div class="example-container" id="aqlArrayUnshift_1_container">
<a class="anchorjs-link " href="#aqlArrayUnshift_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayUnshift_1_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN UNSHIFT( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">4</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">4</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArrayUnshift_1_container_collapse" onclick="$('#aqlArrayUnshift_1_long').hide(); $('#aqlArrayUnshift_1_short').show(); window.location.hash='aqlArrayUnshift_1_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayUnshift_1_short" onclick="$('#aqlArrayUnshift_1_short').hide(); $('#aqlArrayUnshift_1_long').show();">
<strong>Query:</strong>
<pre>
RETURN UNSHIFT( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">4</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayUnshift_1
<!-- filename: /work/ArangoDB/Documentation/Books/AQL/functions-array.md -->
@startDocuBlockInline aqlArrayUnshift_2
<div class="example-container" id="aqlArrayUnshift_2_container">
<a class="anchorjs-link " href="#aqlArrayUnshift_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="aqlArrayUnshift_2_long" style="Display: none;">
<strong>Query:</strong>
<pre>
RETURN UNSHIFT( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">2</span>, <span class="hljs-literal">true</span> )
</pre>
<strong>Query results:</strong>
<pre>
[
[
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>
]
]</pre>
<div id="aqlArrayUnshift_2_container_collapse" onclick="$('#aqlArrayUnshift_2_long').hide(); $('#aqlArrayUnshift_2_short').show(); window.location.hash='aqlArrayUnshift_2_container';" class="example_show_button">Hide query result</div></div>
<div id="aqlArrayUnshift_2_short" onclick="$('#aqlArrayUnshift_2_short').hide(); $('#aqlArrayUnshift_2_long').show();">
<strong>Query:</strong>
<pre>
RETURN UNSHIFT( [ <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span> ], <span class="hljs-number">2</span>, <span class="hljs-literal">true</span> )
</pre><div class="example_show_button">Show query result</div>
</div>
</div>
@endDocuBlock aqlArrayUnshift_2
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/collectionGeo.md -->
@startDocuBlock collectionGeo
@brief constructs a geo index selection
`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**: this method is not yet supported by the RocksDB storage engine.
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.
<div class="example-container" id="geoIndexSimpleQuery_container">
<a class="anchorjs-link " href="#geoIndexSimpleQuery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="geoIndexSimpleQuery_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.complex.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; home : [ i, j ],
........&gt; work : [ -i, -j ] });
........&gt; }
........&gt; }
........&gt;
arangosh&gt; db.complex.near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>);
[ArangoError <span class="hljs-number">1570</span>: no suitable geo index found <span class="hljs-keyword">for</span> geo restriction on <span class="hljs-string">'complex'</span>]
arangosh&gt; db.complex.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"home"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"home"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"complex/86119"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382083742892036"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.complex.near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85448"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85448"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e8G--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/170"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">170</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-170</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85450"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85450"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e8G--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/180"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">180</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-180</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85522"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85522"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e8i--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/170"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">170</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">-170</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85374"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85374"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e7q--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/170"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">170</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">-170</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85378"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85378"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e7q--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/-180"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-180</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">180</span>
]
}
]
arangosh&gt; db.complex.geo(<span class="hljs-string">"work"</span>).near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>);
[ArangoError <span class="hljs-number">1570</span>: no suitable geo index found <span class="hljs-keyword">for</span> geo restriction on <span class="hljs-string">'complex'</span>]
arangosh&gt; db.complex.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"work"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"work"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"complex/86128"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382083748134912"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; db.complex.geo(<span class="hljs-string">"work"</span>).near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85448"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85448"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e8G--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/170"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">170</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-170</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85450"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85450"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e8G--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/180"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">180</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-180</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85522"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85522"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e8i--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/170"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">170</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">-170</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85374"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85374"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e7q--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/170"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">170</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">-170</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"85378"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"complex/85378"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6e7q--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/-180"</span>,
<span class="hljs-string">"home"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-180</span>
],
<span class="hljs-string">"work"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">180</span>
]
}
]
</pre>
<div id="geoIndexSimpleQuery_container_collapse" onclick="$('#geoIndexSimpleQuery_long').hide(); $('#geoIndexSimpleQuery_short').show(); window.location.hash='geoIndexSimpleQuery_container';" class="example_show_button">Hide execution results</div></div>
<div id="geoIndexSimpleQuery_short" onclick="$('#geoIndexSimpleQuery_short').hide(); $('#geoIndexSimpleQuery_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.complex.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; home : [ i, j ],
........&gt; work : [ -i, -j ] });
........&gt; }
........&gt; }
........&gt;
arangosh&gt; db.complex.near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>);
arangosh&gt; db.complex.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"home"</span> ] });
arangosh&gt; db.complex.near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>).toArray();
arangosh&gt; db.complex.geo(<span class="hljs-string">"work"</span>).near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>);
arangosh&gt; db.complex.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"work"</span> ] });
arangosh&gt; db.complex.geo(<span class="hljs-string">"work"</span>).near(<span class="hljs-number">0</span>, <span class="hljs-number">170</span>).limit(<span class="hljs-number">5</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/WalLogfileAllowOversizeEntries.md -->
@startDocuBlock WalLogfileAllowOversizeEntries
@brief whether or not oversize entries are allowed
`--wal.allow-oversize-entries`
Whether or not it is allowed to store individual documents that are bigger
than would fit into a single logfile. Setting the option to false will
make
such operations fail with an error. Setting the option to true will make
such operations succeed, but with a high potential performance impact.
The reason is that for each oversize operation, an individual oversize
logfile needs to be created which may also block other operations.
The option should be set to *false* if it is certain that documents will
always have a size smaller than a single logfile.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/databaseMaximalJournalSize.md -->
@startDocuBlock databaseMaximalJournalSize
`--database.maximal-journal-size size`
Maximal size of journal in bytes. Can be overwritten when creating a new
collection. Note that this also limits the maximal size of a single
document.
The default is *32MB*.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/server_authentication.md -->
@startDocuBlock server_authentication
`--server.authentication`
Setting this option to *false* will turn off authentication on the server side
so all clients can execute any action without authorization and privilege
checks.
The default value is *true*.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/serverAuthenticateSystemOnly.md -->
@startDocuBlock serverAuthenticateSystemOnly
`--server.authentication-system-only boolean`
Controls whether incoming requests need authentication only if they are
directed to the ArangoDB's internal APIs and features, located at
*/_api/*,
*/_admin/* etc.
If the flag is set to *true*, then HTTP authentication is only
required for requests going to URLs starting with */_*, but not for other
URLs. The flag can thus be used to expose a user-made API without HTTP
authentication to the outside world, but to prevent the outside world from
using the ArangoDB API and the admin interface without authentication.
Note that checking the URL is performed after any database name prefix
has been removed. That means when the actual URL called is
*/_db/_system/myapp/myaction*, the URL */myapp/myaction* will be used for
*authentication-system-only* check.
The default is *true*.
Note that authentication still needs to be enabled for the server regularly
in order for HTTP authentication to be forced for the ArangoDB API and the
web interface. Setting only this flag is not enough.
You can control ArangoDB's general authentication feature with the
*--server.authentication* flag.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/documentRevision.md -->
@startDocuBlock documentRevision
Every document in ArangoDB has a revision, stored in the system attribute
`_rev`. It is fully managed by the server and read-only for the user.
Its value should be treated as opaque, no guarantees regarding its format
and properties are given except that it will be different after a
document update. More specifically, `_rev` values are unique across all
documents and all collections in a single server setup. In a cluster setup,
within one shard it is guaranteed that two different document revisions
have a different `_rev` string, even if they are written in the same
millisecond.
The `_rev` attribute can be used as a pre-condition for queries, to avoid
_lost update_ situations. That is, if a client fetches a document from the server,
modifies it locally (but with the `_rev` attribute untouched) and sends it back
to the server to update the document, but meanwhile the document was changed by
another operation, then the revisions do not match anymore and the operation
is cancelled by the server. Without this mechanism, the client would
accidentally overwrite changes made to the document without knowing about it.
When an existing document is updated or replaced, ArangoDB will write a new
version of this document to the write-ahead logfile (regardless of the
storage engine). When the new version of the document has been written, the
old version(s) will still be present, at least on disk. The same is true when
an existing document (version) gets removed: the old version of the document
plus the removal operation will be on disk for some time.
On disk it is therefore possible that multiple revisions of the same document
(as identified by the same `_key` value) exist at the same time. However,
stale revisions **are not accessible**. Once a document was updated or removed
successfully, no query or other data retrieval operation done by the user
will be able to see it any more. Furthermore, after some time, old revisions
will be removed internally. This is to avoid ever-growing disk usage.
{% hint 'warning' %}
From a **user perspective**, there is just **one single document revision
present per different `_key`** at every point in time. There is no built-in
system to automatically keep a history of all changes done to a document
and old versions of a document can not be restored via the `_rev` value.
{% endhint %}
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/WalLogfileSyncInterval.md -->
@startDocuBlock WalLogfileSyncInterval
@brief interval for automatic, non-requested disk syncs
`--wal.sync-interval`
The interval (in milliseconds) that ArangoDB will use to automatically
synchronize data in its write-ahead logs to disk. Automatic syncs will
only be performed for not-yet synchronized data, and only for operations
that have been executed without the *waitForSync* attribute.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/WalLogfileFlushTimeout.md -->
@startDocuBlock WalLogfileFlushTimeout
@brief WAL flush timeout
`--wal.flush-timeout
The timeout (in milliseconds) that ArangoDB will at most wait when flushing
a full WAL logfile to disk. When the timeout is reached and the flush is
not completed, the operation that requested the flush will fail with a
*lock timeout* error.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/collectionNear.md -->
@startDocuBlock collectionNear
@brief constructs a near query for a collection
`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**: this method is not yet supported by the RocksDB storage engine.
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:
```js
FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit)
RETURN doc
```
@EXAMPLES
To get the nearest two locations:
<div class="example-container" id="007_collectionNear_container">
<a class="anchorjs-link " href="#007_collectionNear_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="007_collectionNear_long" style="Display: none;">
<pre>
arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"loc"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"geo/228"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382025063530498"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({
........&gt; name : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; loc: [ i, j ] });
........&gt; } }
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">2</span>).toArray();
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"934"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/934"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5obG--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"1008"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/1008"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5obi--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/0"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">0</span>
]
}
]
</pre>
<div id="007_collectionNear_container_collapse" onclick="$('#007_collectionNear_long').hide(); $('#007_collectionNear_short').show(); window.location.hash='007_collectionNear_container';" class="example_show_button">Hide execution results</div></div>
<div id="007_collectionNear_short" onclick="$('#007_collectionNear_short').hide(); $('#007_collectionNear_long').show();">
<pre>
arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({
........&gt; name : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; loc: [ i, j ] });
........&gt; } }
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).limit(<span class="hljs-number">2</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
If you need the distance as well, then you can use the `distance`
operator:
<div class="example-container" id="008_collectionNearDistance_container">
<a class="anchorjs-link " href="#008_collectionNearDistance_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="008_collectionNearDistance_long" style="Display: none;">
<pre>
arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"loc"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"geo/1649"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382025227108352"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({
........&gt; name : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; loc: [ i, j ] });
........&gt; } }
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).distance().limit(<span class="hljs-number">2</span>).toArray();
[
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/2355"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2355"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ok2--C"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/2429"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"2429"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5olW---"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/0"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1111949.2664455872</span>
}
]
</pre>
<div id="008_collectionNearDistance_container_collapse" onclick="$('#008_collectionNearDistance_long').hide(); $('#008_collectionNearDistance_short').show(); window.location.hash='008_collectionNearDistance_container';" class="example_show_button">Hide execution results</div></div>
<div id="008_collectionNearDistance_short" onclick="$('#008_collectionNearDistance_short').hide(); $('#008_collectionNearDistance_long').show();">
<pre>
arangosh&gt; db.geo.ensureIndex({ <span class="hljs-attr">type</span>: <span class="hljs-string">"geo"</span>, <span class="hljs-attr">fields</span>: [ <span class="hljs-string">"loc"</span> ] });
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({
........&gt; name : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j,
........&gt; loc: [ i, j ] });
........&gt; } }
arangosh&gt; db.geo.near(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>).distance().limit(<span class="hljs-number">2</span>).toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/foxxQueuesPollInterval.md -->
@startDocuBlock foxxQueuesPollInterval
@brief poll interval for Foxx queues
`--foxx.queues-poll-interval value`
The poll interval for the Foxx queues manager. The value is specified in
seconds. Lower values will mean more immediate and more frequent Foxx
queue job execution, but will make the queue thread wake up and query the
queues more often. When set to a low value, the queue thread might cause
CPU load.
The default is *1* second. If Foxx queues are not used much, then this
value may be increased to make the queues thread wake up less.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/WalLogfileHistoricLogfiles.md -->
@startDocuBlock WalLogfileHistoricLogfiles
@brief maximum number of historic logfiles
`--wal.historic-logfiles`
The maximum number of historic logfiles that ArangoDB will keep after they
have been garbage-collected. If no replication is used, there is no need
to keep historic logfiles except for having a local changelog.
In a replication setup, the number of historic logfiles affects the amount
of data a slave can fetch from the master's logs. The more historic
logfiles, the more historic data is available for a slave, which is useful
if the connection between master and slave is unstable or slow. Not having
enough historic logfiles available might lead to logfile data being
deleted
on the master already before a slave has fetched it.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/WalLogfileReserveLogfiles.md -->
@startDocuBlock WalLogfileReserveLogfiles
@brief maximum number of reserve logfiles
`--wal.reserve-logfiles`
The maximum number of reserve logfiles that ArangoDB will create in a
background process. Reserve logfiles are useful in the situation when an
operation needs to be written to a logfile but the reserve space in the
logfile is too low for storing the operation. In this case, a new logfile
needs to be created to store the operation. Creating new logfiles is
normally slow, so ArangoDB will try to pre-create logfiles in a background
process so there are always reserve logfiles when the active logfile gets
full. The number of reserve logfiles that ArangoDB keeps in the background
is configurable with this option.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/general_graph_example_description.md -->
@startDocuBlock general_graph_example_description
For many of the following functions *examples* can be passed in as a parameter.
*Examples* are used to filter the result set for objects that match the conditions.
These *examples* can have the following values:
* *null*, there is no matching executed all found results are valid.
* A *string*, only results are returned, which *_id* equal the value of the string
* An example *object*, defining a set of attributes.
Only results having these attributes are matched.
* A *list* containing example *objects* and/or *strings*.
All results matching at least one of the elements in the list are returned.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/foxxQueues.md -->
@startDocuBlock foxxQueues
@brief enable or disable the Foxx queues feature
`--foxx.queues flag`
If *true*, the Foxx queues will be available and jobs in the queues will
be executed asynchronously.
The default is *true*.
When set to `false` the queue manager will be disabled and any jobs
are prevented from being processed, which may reduce CPU load a bit.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/collectionWithin.md -->
@startDocuBlock collectionWithin
@brief constructs a within query for a collection
`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**: this method is not yet supported by the RocksDB storage engine.
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:
<div class="example-container" id="009_collectionWithin_container">
<a class="anchorjs-link " href="#009_collectionWithin_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="009_collectionWithin_long" style="Display: none;">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">loc</span>: [ i, j ] }); } }
arangosh&gt; db.geo.within(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">2000</span> * <span class="hljs-number">1000</span>).distance().toArray();
[
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3776"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3776"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ouW---"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/0"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3850"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3850"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ouy--A"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/0"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1111949.2664455872</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3778"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3778"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ouW--A"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">10</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/10"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1111949.2664455872</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3702"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3702"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ot2--G"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/0"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1111949.2664455872</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3774"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3774"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ouS--G"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">-10</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0/-10"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1111949.2664455872</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3700"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3700"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ot2--E"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">-10</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/-10"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1568520.556798576</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3852"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3852"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ouy--C"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">10</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/10"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1568520.556798576</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3848"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3848"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ouy---"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">10</span>,
<span class="hljs-number">-10</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/10/-10"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1568520.556798576</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"geo/3704"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"3704"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5ot6---"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-10</span>,
<span class="hljs-number">10</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-10/10"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">1568520.556798576</span>
}
]
</pre>
<div id="009_collectionWithin_container_collapse" onclick="$('#009_collectionWithin_long').hide(); $('#009_collectionWithin_short').show(); window.location.hash='009_collectionWithin_container';" class="example_show_button">Hide execution results</div></div>
<div id="009_collectionWithin_short" onclick="$('#009_collectionWithin_short').hide(); $('#009_collectionWithin_long').show();">
<pre>
arangosh&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">-90</span>; i &lt;= <span class="hljs-number">90</span>; i += <span class="hljs-number">10</span>) {
........&gt; <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">-180</span>; j &lt;= <span class="hljs-number">180</span>; j += <span class="hljs-number">10</span>) {
........&gt; db.geo.save({ <span class="hljs-attr">name</span> : <span class="hljs-string">"Name/"</span> + i + <span class="hljs-string">"/"</span> + j, <span class="hljs-attr">loc</span>: [ i, j ] }); } }
arangosh&gt; db.geo.within(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">2000</span> * <span class="hljs-number">1000</span>).distance().toArray();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/WalLogfileSize.md -->
@startDocuBlock WalLogfileSize
@brief the size of each WAL logfile
`--wal.logfile-size`
Specifies the filesize (in bytes) for each write-ahead logfile. The
logfile
size should be chosen so that each logfile can store a considerable amount
of
documents. The bigger the logfile size is chosen, the longer it will take
to fill up a single logfile, which also influences the delay until the
data
in a logfile will be garbage-collected and written to collection journals
and datafiles. It also affects how long logfile recovery will take at
server start.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/databaseForceSyncProperties.md -->
@startDocuBlock databaseForceSyncProperties
@brief force syncing of collection properties to disk
`--database.force-sync-properties boolean`
Force syncing of collection properties to disk after creating a collection
or updating its properties.
If turned off, no fsync will happen for the collection and database
properties stored in `parameter.json` files in the file system. Turning
off this option will speed up workloads that create and drop a lot of
collections (e.g. test suites).
The default is *true*.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/databaseWaitForSync.md -->
@startDocuBlock databaseWaitForSync
@brief default wait for sync behavior
`--database.wait-for-sync boolean`
Default wait-for-sync value. Can be overwritten when creating a new
collection.
The default is *false*.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/collectionProperties.md -->
@startDocuBlock collectionProperties
@brief gets or sets the properties of a collection
`collection.properties()`
Returns an object containing all collection properties.
* *waitForSync*: If *true* creating a document will only return
after the data was synced to disk.
* *journalSize* : The size of the journal in bytes.
This option is meaningful for the MMFiles storage engine only.
* *isVolatile*: If *true* then the collection data will be
kept in memory only and ArangoDB will not write or sync the data
to disk.
This option is meaningful for the MMFiles storage engine only.
* *keyOptions* (optional) additional options for key generation. This is
a JSON array containing the following attributes (note: some of the
attributes are optional):
* *type*: the type of the key generator used for the collection.
* *allowUserKeys*: if set to *true*, then it is allowed to supply
own key values in the *_key* attribute of a document. If set to
*false*, then the key generator will solely be responsible for
generating keys and supplying own key values in the *_key* attribute
of documents is considered an error.
* *increment*: increment value for *autoincrement* key generator.
Not used for other key generator types.
* *offset*: initial offset value for *autoincrement* key generator.
Not used for other key generator types.
* *indexBuckets*: number of buckets into which indexes using a hash
table are split. The default is 16 and this number has to be a
power of 2 and less than or equal to 1024.
This option is meaningful for the MMFiles storage engine only.
For very large collections one should increase this to avoid long pauses
when the hash table has to be initially built or resized, since buckets
are resized individually and can be initially built in parallel. For
example, 64 might be a sensible value for a collection with 100
000 000 documents. Currently, only the edge index respects this
value, but other index types might follow in future ArangoDB versions.
Changes (see below) are applied when the collection is loaded the next
time.
In a cluster setup, the result will also contain the following attributes:
* *numberOfShards*: the number of shards of the collection.
* *shardKeys*: contains the names of document attributes that are used to
determine the target shard for documents.
* *replicationFactor*: determines how many copies of each shard are kept
on different DBServers. Has to be in the range of 1-10 *(Cluster only)*
* *minReplicationFactor* : determines the number of minimal shard copies kept on
different DBServers, a shard will refuse to write if less than this amount
of copies are in sync. Has to be in the range of 1-replicationFactor *(Cluster only)*
* *shardingStrategy*: the sharding strategy selected for the collection.
This attribute will only be populated in cluster mode and is not populated
in single-server mode.
`collection.properties(properties)`
Changes the collection properties. *properties* must be an object with
one or more of the following attribute(s):
* *waitForSync*: If *true* creating a document will only return
after the data was synced to disk.
* *journalSize* : The size of the journal in bytes.
This option is meaningful for the MMFiles storage engine only.
* *indexBuckets* : See above, changes are only applied when the
collection is loaded the next time.
This option is meaningful for the MMFiles storage engine only.
* *replicationFactor* : Change the number of shard copies kept on
different DBServers, valid values are integer numbers
in the range of 1-10 *(Cluster only)*
* *minReplicationFactor* : Change the number of minimal shard copies to be in sync on
different DBServers, a shard will refuse to write if less than this amount
of copies are in sync. Has to be in the range of 1-replicationFactor *(Cluster only)*
**Note**: some other collection properties, such as *type*, *isVolatile*,
*keyOptions*, *numberOfShards* or *shardingStrategy* cannot be changed once
the collection is created.
@EXAMPLES
Read all properties
<div class="example-container" id="collectionProperties_container">
<a class="anchorjs-link " href="#collectionProperties_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionProperties_long" style="Display: none;">
<pre>
arangosh&gt; db.example.properties();
{
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="collectionProperties_container_collapse" onclick="$('#collectionProperties_long').hide(); $('#collectionProperties_short').show(); window.location.hash='collectionProperties_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionProperties_short" onclick="$('#collectionProperties_short').hide(); $('#collectionProperties_long').show();">
<pre>
arangosh&gt; db.example.properties();
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
Change a property
<div class="example-container" id="collectionProperty_container">
<a class="anchorjs-link " href="#collectionProperty_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="collectionProperty_long" style="Display: none;">
<pre>
arangosh&gt; db.example.properties({ <span class="hljs-attr">waitForSync</span> : <span class="hljs-literal">true</span> });
{
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="collectionProperty_container_collapse" onclick="$('#collectionProperty_long').hide(); $('#collectionProperty_short').show(); window.location.hash='collectionProperty_container';" class="example_show_button">Hide execution results</div></div>
<div id="collectionProperty_short" onclick="$('#collectionProperty_short').hide(); $('#collectionProperty_long').show();">
<pre>
arangosh&gt; db.example.properties({ <span class="hljs-attr">waitForSync</span> : <span class="hljs-literal">true</span> });
</pre><div class="example_show_button">Show execution results</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_restore.md -->
@startDocuBlock post_admin_backup_restore
@brief restores from a local backup
@RESTHEADER{POST /_admin/backup/restore, Restore backup}
@RESTDESCRIPTION
Restores a consistent backup from a
snapshot in time, with a given id. The backup snapshot must reside on
the ArangoDB service locally.
@RESTBODYPARAM{id,string,required,string}
The id of the backup to restore from.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the backup could be restored. Note that there is an
inevitable discrepancy between the single server and the cluster. In a
single server, the request returns successfully, but the restore is
only executed afterwards. In the cluster, the request only returns when
the restore operation has been completed successfully. The cluster
behaviour is obviously the desired one, but in a single instance, one
cannot keep a connection open across a restart.
@RESTRETURNCODE{400}
If the restore command is invoked with bad parameters or any HTTP
method other than `POST`, then an *HTTP 400* is returned. The specifics
are detailed in the returned error document.
@EXAMPLES
<div class="example-container" id="RestBackupRestoreBackup_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupRestoreBackup_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupRestoreBackup_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/restore</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.18.13Z_de63c65b-f9ac-442d-987b-ee9628d54ba9"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"previous"</span> : <span class="hljs-string">"FAILSAFE"</span>
}
}
</pre>
<div id="RestBackupRestoreBackup_rocksdb_container_collapse" onclick="$('#RestBackupRestoreBackup_rocksdb_long').hide(); $('#RestBackupRestoreBackup_rocksdb_short').show(); window.location.hash='RestBackupRestoreBackup_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupRestoreBackup_rocksdb_short" onclick="$('#RestBackupRestoreBackup_rocksdb_short').hide(); $('#RestBackupRestoreBackup_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/restore</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.18.13Z_de63c65b-f9ac-442d-987b-ee9628d54ba9"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
The `result` object returns the `id` of the fail safe hot backup to return to, if necessary. And the all telling `isCluster` boolean attribute.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_create.md -->
@startDocuBlock post_admin_backup_create
@brief creates a local backup
@RESTHEADER{POST /_admin/backup/create, Create backup}
@RESTDESCRIPTION
Creates a consistent backup "as soon as possible", very much
like a snapshot in time, with a given label. The ambiguity in the
phrase "as soon as possible" refers to the next window during which a
global write lock across all databases can be obtained in order to
guarantee consistency. Note that the backup at first resides on the
same machine and hard drive as the original data. Make sure to upload
it to a remote site for an actual backup.
@RESTBODYPARAM{label,string,optional,string}
The label for this backup. The label is used together with a
timestamp string create a unique backup identifier, `<timestamp>_<label>`.
If no label is specified, the empty string is assumed and a default
UUID is created for this part of the ID.
@RESTBODYPARAM{timeout,number,optional,double}
The time in seconds that the operation tries to get a consistent
snapshot. The default is 120 seconds.
@RESTBODYPARAM{allowInconsistent,boolean,optional,boolean}
If this flag is set to `true` and no global transaction lock can be
acquired within the given timeout, a possibly inconsistent backup
is taken. The default for this flag is `false` and in this case
a timeout results in an HTTP 408 error.
@RESTRETURNCODES
@RESTRETURNCODE{201}
If all is well, code 201 is returned.
@RESTRETURNCODE{400}
If the create command is invoked with bad parameters or any HTTP
method other than `POST`, then an *HTTP 400* is returned. The specifics
are detailed in the returned error document.
@RESTRETURNCODE{408}
If the operation cannot obtain a global transaction lock
within the timeout, then an *HTTP 408* is returned.
@EXAMPLES
<div class="example-container" id="RestBackupCreateBackup_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupCreateBackup_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupCreateBackup_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/create</span> &lt;&lt;EOF
{
<span class="hljs-string">"label"</span> : <span class="hljs-string">"foo"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.17.41Z_foo"</span>,
<span class="hljs-string">"potentiallyInconsistent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sizeInBytes"</span> : <span class="hljs-number">1855314</span>,
<span class="hljs-string">"datetime"</span> : <span class="hljs-string">"2019-10-03T14:17:41Z"</span>,
<span class="hljs-string">"nrDBServers"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"nrFiles"</span> : <span class="hljs-number">6</span>
}
}
</pre>
<div id="RestBackupCreateBackup_rocksdb_container_collapse" onclick="$('#RestBackupCreateBackup_rocksdb_long').hide(); $('#RestBackupCreateBackup_rocksdb_short').show(); window.location.hash='RestBackupCreateBackup_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupCreateBackup_rocksdb_short" onclick="$('#RestBackupCreateBackup_rocksdb_short').hide(); $('#RestBackupCreateBackup_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/create</span> &lt;&lt;EOF
{
<span class="hljs-string">"label"</span> : <span class="hljs-string">"foo"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
The result `body` contains besides the above discussed error codes the `result` object, if `code` is equal to `201`, which holds the unique identifier of this hot backup as the string attibute `id`, the full size in bytes as `sizeInBytes`, the number of idividual files as `nrFiles` and the number of database servers as `nrDBServers`. Single server deployments list potentially misleadingly `nrDBServers: 1`. Furthermore, the body contains a `datetime` time stamp and the flag `potentiallyInconsistent`, which indicates that the backup could inconsistent. This only happens if `allowInconsistent` has happened.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_list.md -->
@startDocuBlock post_admin_backup_list
@brief list all local backups
@RESTHEADER{POST /_admin/backup/list, List backups}
@RESTDESCRIPTION
Lists all locally found backups.
@RESTBODYPARAM{id,string,optional,string}
The body can either be empty (in which case all available backups are
listed), or it can be an object with an attribute `id`, which
is a string. In the latter case the returned list
is restricted to the backup with the given id.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If all is well, code 200 is returned.
@RESTRETURNCODE{400}
If the list command is invoked with bad parameters, then an *HTTP 400*
is returned.
@RESTRETURNCODE{404}
If an `id` or a list of ids was given and the given ids were not found
as identifiers of a backup, an *HTTP 404 NOT FOUND* is returned.
@RESTRETURNCODE{405}
If the list command is invoked with any HTTP
method other than `POST`, then an *HTTP 405 METHOD NOT ALLOWED* is returned.
@EXAMPLES
<div class="example-container" id="RestBackupListBackup_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupListBackup_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupListBackup_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/list</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"server"</span> : <span class="hljs-string">"SNGL-79589957-6ee7-4479-a1ad-22231b316b27"</span>,
<span class="hljs-string">"list"</span> : {
<span class="hljs-string">"2019-10-03T14.18.13Z_427fb383-186d-45f1-aa32-049a6127d281"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.18.13Z_427fb383-186d-45f1-aa32-049a6127d281"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"datetime"</span> : <span class="hljs-string">"2019-10-03T14:18:13Z"</span>,
<span class="hljs-string">"sizeInBytes"</span> : <span class="hljs-number">778853</span>,
<span class="hljs-string">"nrFiles"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"nrDBServers"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"available"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"nrPiecesPresent"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"potentiallyInconsistent"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"2019-10-03T14.18.13Z_f4be8fae-fa3d-4377-891c-f717857b7634"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.18.13Z_f4be8fae-fa3d-4377-891c-f717857b7634"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"datetime"</span> : <span class="hljs-string">"2019-10-03T14:18:13Z"</span>,
<span class="hljs-string">"sizeInBytes"</span> : <span class="hljs-number">529505</span>,
<span class="hljs-string">"nrFiles"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"nrDBServers"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"available"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"nrPiecesPresent"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"potentiallyInconsistent"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"2019-10-03T14.17.41Z_foo"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.17.41Z_foo"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"datetime"</span> : <span class="hljs-string">"2019-10-03T14:17:41Z"</span>,
<span class="hljs-string">"sizeInBytes"</span> : <span class="hljs-number">1855314</span>,
<span class="hljs-string">"nrFiles"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"nrDBServers"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"available"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"nrPiecesPresent"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"potentiallyInconsistent"</span> : <span class="hljs-literal">false</span>
}
}
}
}
</pre>
<div id="RestBackupListBackup_rocksdb_container_collapse" onclick="$('#RestBackupListBackup_rocksdb_long').hide(); $('#RestBackupListBackup_rocksdb_short').show(); window.location.hash='RestBackupListBackup_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupListBackup_rocksdb_short" onclick="$('#RestBackupListBackup_rocksdb_short').hide(); $('#RestBackupListBackup_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/list</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
The result consists of a `list` object of hot backups by their `id`, where `id` uniquely identifies a specific hot backup, `version` depicts the version of ArangoDB, which was used to create any individual hot backup and `datetime` displays the time of creation of the hot backup. Further parameters are the size of the backup in bytes as `sizeInBytes`, the number of individual data files as `nrFiles`, the number of db servers at time of creation as `nrDBServers`, the number of backup parts, which are found on the currently reachable db servers as `nrPiecesPresent`. If the backup was created allowing inconsistences, it is so denoted as `potentiallyInconsistent`. The `available` boolean parameter is tightly connected to the backup to be present and ready to be restored on all db servers. It is `true` except, when the number of db servers currently reachable does not match to the number of db servers listed in the backup.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_download.md -->
@startDocuBlock post_admin_backup_download
@brief download a specific local backup
@RESTHEADER{POST /_admin/backup/download, Download a backup from a remote repository}
@RESTDESCRIPTION
Download a specific local backup from a remote repository, or query
progress on a previously scheduled download operation, or abort
a running download operation.
@RESTBODYPARAM{id,string,optional,string}
The identifier for this backup. This is required when a download
operation is scheduled. In this case leave out the `downloadId`
attribute.
@RESTBODYPARAM{remoteRepository,string,required,string}
URL of remote reporsitory. This is required when a download
operation is scheduled. In this case leave out the `downloadId`
attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configurtion section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as `..` and `.` are applied accordingly. Local repositories must be absolute paths and must begin with a `/`. Trailing `/` are removed.
@RESTBODYPARAM{config,object,required,object}
Configuration of remote repository. This is required when a download
operation is scheduled. In this case leave out the `downloadId`
attribute. See the description of the _arangobackup_ program in the manual
for a description of the `config` object.
@RESTBODYPARAM{downloadId,string,optional,string}
Download ID to specify for which download operation progress is queried, or
the download operation to abort.
If you specify this, leave out all the above body parameters.
@RESTBODYPARAM{abort,boolean,optional,boolean}
Set this to `true` if a running download operation should be aborted. In
this case, the only other body parameter which is needed is `downloadId`.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If all is well, code 200 is returned if progress is inquired or the
operation is aborted.
@RESTRETURNCODE{202}
If all is well, code 202 is returned if a new operation is scheduled.
@RESTRETURNCODE{400}
If the download command is invoked with bad parameters or any HTTP
method other than `POST`, then an *HTTP 400* is returned.
@RESTRETURNCODE{401}
If the authentication to the rempote repository fails, then an *HTTP
401* is returned.
@RESTRETURNCODE{404}
If a backup corresponding to the identifier `id` cannot be found, or if
there is no known download operation with the given `downloadId`.
@EXAMPLES
<div class="example-container" id="RestBackupDownloadBackup_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupDownloadBackup_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupDownloadBackup_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/download</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.17.57Z_5e7074df-aa86-4e5d-be3a-3f1bc26f5e9d"</span>,
<span class="hljs-string">"remoteRepository"</span> : <span class="hljs-string">"local://tmp/backups"</span>,
<span class="hljs-string">"config"</span> : {
<span class="hljs-string">"local"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"local"</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"downloadId"</span> : <span class="hljs-string">"69046"</span>
}
}
</pre>
<div id="RestBackupDownloadBackup_rocksdb_container_collapse" onclick="$('#RestBackupDownloadBackup_rocksdb_long').hide(); $('#RestBackupDownloadBackup_rocksdb_short').show(); window.location.hash='RestBackupDownloadBackup_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupDownloadBackup_rocksdb_short" onclick="$('#RestBackupDownloadBackup_rocksdb_short').hide(); $('#RestBackupDownloadBackup_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/download</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.17.57Z_5e7074df-aa86-4e5d-be3a-3f1bc26f5e9d"</span>,
<span class="hljs-string">"remoteRepository"</span> : <span class="hljs-string">"local://tmp/backups"</span>,
<span class="hljs-string">"config"</span> : {
<span class="hljs-string">"local"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"local"</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
The `result` object of the body holds the `downloadId` string attribute which can be used to follow the download process.
<div class="example-container" id="RestBackupDownloadBackupStarted_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupDownloadBackupStarted_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupDownloadBackupStarted_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/download</span> &lt;&lt;EOF
{
<span class="hljs-string">"downloadId"</span> : <span class="hljs-string">"69033"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"Timestamp"</span> : <span class="hljs-string">"2019-10-03T14:17:57Z"</span>,
<span class="hljs-string">"DownloadId"</span> : <span class="hljs-string">"69033"</span>,
<span class="hljs-string">"Cancelled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"BackupId"</span> : <span class="hljs-string">"2019-10-03T14.17.42Z_1b219dd6-0740-40bd-b360-50f1b0e43f93"</span>,
<span class="hljs-string">"DBServers"</span> : {
<span class="hljs-string">"SNGL"</span> : {
<span class="hljs-string">"Status"</span> : <span class="hljs-string">"STARTED"</span>
}
}
}
}
</pre>
<div id="RestBackupDownloadBackupStarted_rocksdb_container_collapse" onclick="$('#RestBackupDownloadBackupStarted_rocksdb_long').hide(); $('#RestBackupDownloadBackupStarted_rocksdb_short').show(); window.location.hash='RestBackupDownloadBackupStarted_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupDownloadBackupStarted_rocksdb_short" onclick="$('#RestBackupDownloadBackupStarted_rocksdb_short').hide(); $('#RestBackupDownloadBackupStarted_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/download</span> &lt;&lt;EOF
{
<span class="hljs-string">"downloadId"</span> : <span class="hljs-string">"69033"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_delete.md -->
@startDocuBlock post_admin_backup_delete
@brief delete a specific local backup
@RESTHEADER{POST /_admin/backup/delete, Delete a backup}
@RESTDESCRIPTION
Delete a specific local backup identified by the given `id`.
@RESTBODYPARAM{id,string,required,string}
The identifier for this backup.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If all is well, this code 200 is returned.
@RESTRETURNCODE{400}
If the delete command is invoked with bad parameters or any HTTP
method other than `POST`, then an *HTTP 400* is returned.
@RESTRETURNCODE{404}
If a backup corresponding to the identifier `id` cannot be found.
@EXAMPLES
<div class="example-container" id="RestBackupDeleteBackup_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupDeleteBackup_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupDeleteBackup_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/delete</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.17.42Z_cc8c2a9e-7790-4066-b20c-19932c3e4b1b"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
}
}
</pre>
<div id="RestBackupDeleteBackup_rocksdb_container_collapse" onclick="$('#RestBackupDeleteBackup_rocksdb_long').hide(); $('#RestBackupDeleteBackup_rocksdb_short').show(); window.location.hash='RestBackupDeleteBackup_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupDeleteBackup_rocksdb_short" onclick="$('#RestBackupDeleteBackup_rocksdb_short').hide(); $('#RestBackupDeleteBackup_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/delete</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.17.42Z_cc8c2a9e-7790-4066-b20c-19932c3e4b1b"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/BackupRestore/post_admin_backup_upload.md -->
@startDocuBlock post_admin_backup_upload
@brief upload a specific local backup
@RESTHEADER{POST /_admin/backup/upload, Upload a backup to a remote repository}
@RESTDESCRIPTION
Upload a specific local backup to a remote repository, or query
progress on a previously scheduled upload operation, or abort
a running upload operation.
@RESTBODYPARAM{id,string,optional,string}
The identifier for this backup. This is required when an upload
operation is scheduled. In this case leave out the `uploadId`
attribute.
@RESTBODYPARAM{remoteRepository,string,optional,string}
URL of remote reporsitory. This is required when an upload
operation is scheduled. In this case leave out the `uploadId`
attribute. Provided repository URLs are normalized and validated as follows: One single colon must appear separating the configurtion section name and the path. The URL prefix up to the colon must exist as a key in the config object below. No slashes must appear before the colon. Multiple back to back slashes are collapsed to one, as `..` and `.` are applied accordingly. Local repositories must be absolute paths and must begin with a `/`. Trailing `/` are removed.
@RESTBODYPARAM{config,object,optional,object}
Configuration of remote repository. This is required when an upload
operation is scheduled. In this case leave out the `uploadId`
attribute. See the description of the _arangobackup_ program in the manual
for a description of the `config` object.
@RESTBODYPARAM{uploadId,string,optional,string}
Upload ID to specify for which upload operation progress is queried or
the upload operation to abort.
If you specify this, leave out all the above body parameters.
@RESTBODYPARAM{abort,boolean,optional,boolean}
Set this to `true` if a running upload operation should be aborted. In
this case, the only other body parameter which is needed is `uploadId`.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If all is well, code 200 is returned if progress is inquired or the
operation is aborted.
@RESTRETURNCODE{202}
If all is well, code 202 is returned if a new operation is scheduled.
@RESTRETURNCODE{400}
If the upload command is invoced with bad parameters or any HTTP
method other than `POST`, then an *HTTP 400* is returned.
@RESTRETURNCODE{401}
If the authentication to the rempote repository fails, then an *HTTP
400* is returned.
@RESTRETURNCODE{404}
If a backup corresponding to the identifier `id` cannot be found, or if
there is no known upload operation with the given `uploadId`.
@EXAMPLES
<div class="example-container" id="RestBackupUploadBackup_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupUploadBackup_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupUploadBackup_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/upload</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.18.17Z_42130e58-c76a-4d9e-861c-470bad078e7a"</span>,
<span class="hljs-string">"remoteRepository"</span> : <span class="hljs-string">"local://tmp/backups"</span>,
<span class="hljs-string">"config"</span> : {
<span class="hljs-string">"local"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"local"</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"uploadId"</span> : <span class="hljs-string">"69084"</span>
}
}
</pre>
<div id="RestBackupUploadBackup_rocksdb_container_collapse" onclick="$('#RestBackupUploadBackup_rocksdb_long').hide(); $('#RestBackupUploadBackup_rocksdb_short').show(); window.location.hash='RestBackupUploadBackup_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupUploadBackup_rocksdb_short" onclick="$('#RestBackupUploadBackup_rocksdb_short').hide(); $('#RestBackupUploadBackup_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/upload</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"2019-10-03T14.18.17Z_42130e58-c76a-4d9e-861c-470bad078e7a"</span>,
<span class="hljs-string">"remoteRepository"</span> : <span class="hljs-string">"local://tmp/backups"</span>,
<span class="hljs-string">"config"</span> : {
<span class="hljs-string">"local"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"local"</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
The `result` object of the body holds the `uploadId` string attribute which can be used to follow the upload process.
<div class="example-container" id="RestBackupUploadBackupStarted_rocksdb_container">
<a class="anchorjs-link " href="#RestBackupUploadBackupStarted_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBackupUploadBackupStarted_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/upload</span> &lt;&lt;EOF
{
<span class="hljs-string">"uploadId"</span> : <span class="hljs-string">"69082"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"Timestamp"</span> : <span class="hljs-string">"2019-10-03T14:18:17Z"</span>,
<span class="hljs-string">"UploadId"</span> : <span class="hljs-string">"69082"</span>,
<span class="hljs-string">"Cancelled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"BackupId"</span> : <span class="hljs-string">"2019-10-03T14.18.16Z_f3ae74ee-dc43-4089-aabb-d8089e55f5b3"</span>,
<span class="hljs-string">"DBServers"</span> : {
<span class="hljs-string">"SNGL"</span> : {
<span class="hljs-string">"Status"</span> : <span class="hljs-string">"STARTED"</span>
}
}
}
}
</pre>
<div id="RestBackupUploadBackupStarted_rocksdb_container_collapse" onclick="$('#RestBackupUploadBackupStarted_rocksdb_long').hide(); $('#RestBackupUploadBackupStarted_rocksdb_short').show(); window.location.hash='RestBackupUploadBackupStarted_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBackupUploadBackupStarted_rocksdb_short" onclick="$('#RestBackupUploadBackupStarted_rocksdb_short').hide(); $('#RestBackupUploadBackupStarted_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/backup/upload</span> &lt;&lt;EOF
{
<span class="hljs-string">"uploadId"</span> : <span class="hljs-string">"69082"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Bulk/import_document.md -->
@startDocuBlock import_document
@brief imports documents from JSON-encoded lists
@RESTHEADER{POST /_api/import#document,imports document values, RestImportHandler#document}
@RESTALLBODYPARAM{documents,string,required}
The body must consist of JSON-encoded arrays of attribute values, with one
line per document. The first row of the request must be a JSON-encoded
array of attribute names. These attribute names are used for the data in the
subsequent lines.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,required}
The collection name.
@RESTQUERYPARAM{fromPrefix,string,optional}
An optional prefix for the values in `_from` attributes. If specified, the
value is automatically prepended to each `_from` input value. This allows
specifying just the keys for `_from`.
@RESTQUERYPARAM{toPrefix,string,optional}
An optional prefix for the values in `_to` attributes. If specified, the
value is automatically prepended to each `_to` input value. This allows
specifying just the keys for `_to`.
@RESTQUERYPARAM{overwrite,boolean,optional}
If this parameter has a value of `true` or `yes`, then all data in the
collection will be removed prior to the import. Note that any existing
index definitions will be preseved.
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until documents have been synced to disk before returning.
@RESTQUERYPARAM{onDuplicate,string,optional}
Controls what action is carried out in case of a unique key constraint
violation. Possible values are:
- *error*: this will not import the current document because of the unique
key constraint violation. This is the default setting.
- *update*: this will update an existing document in the database with the
data specified in the request. Attributes of the existing document that
are not present in the request will be preseved.
- *replace*: this will replace an existing document in the database with the
data specified in the request.
- *ignore*: this will not update an existing document and simply ignore the
error caused by the unique key constraint violation.
Note that *update*, *replace* and *ignore* will only work when the
import document in the request contains the *_key* attribute. *update* and
*replace* may also fail because of secondary unique key constraint
violations.
@RESTQUERYPARAM{complete,boolean,optional}
If set to `true` or `yes`, it will make the whole import fail if any error
occurs. Otherwise the import will continue even if some documents cannot
be imported.
@RESTQUERYPARAM{details,boolean,optional}
If set to `true` or `yes`, the result will include an attribute `details`
with details about documents that could not be imported.
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates documents in the collection identified by `collection-name`.
The first line of the request body must contain a JSON-encoded array of
attribute names. All following lines in the request body must contain
JSON-encoded arrays of attribute values. Each line is interpreted as a
separate document, and the values specified will be mapped to the array
of attribute names specified in the first header line.
The response is a JSON object with the following attributes:
- `created`: number of documents imported.
- `errors`: number of documents that were not imported due to an error.
- `empty`: number of empty lines found in the input (will only contain a
value greater zero for types `documents` or `auto`).
- `updated`: number of updated/replaced documents (in case `onDuplicate`
was set to either `update` or `replace`).
- `ignored`: number of failed but ignored insert operations (in case
`onDuplicate` was set to `ignore`).
- `details`: if query parameter `details` is set to true, the result will
contain a `details` attribute which is an array with more detailed
information about which documents could not be inserted.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if all documents could be imported successfully.
@RESTRETURNCODE{400}
is returned if `type` contains an invalid value, no `collection` is
specified, the documents are incorrectly encoded, or the request
is malformed.
@RESTRETURNCODE{404}
is returned if `collection` or the `_from` or `_to` attributes of an
imported edge refer to an unknown collection.
@RESTRETURNCODE{409}
is returned if the import would trigger a unique key violation and
`complete` is set to `true`.
@RESTRETURNCODE{500}
is returned if the server cannot auto-generate a document key (out of keys
error) for a document with no user-defined key.
@EXAMPLES
Importing two documents, with attributes `_key`, `value1` and `value2` each. One
line in the import data is empty
<div class="example-container" id="RestImportCsvExample_container">
<a class="anchorjs-link " href="#RestImportCsvExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvExample_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products</span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
[ "foo", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestImportCsvExample_container_collapse" onclick="$('#RestImportCsvExample_long').hide(); $('#RestImportCsvExample_short').show(); window.location.hash='RestImportCsvExample_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvExample_short" onclick="$('#RestImportCsvExample_short').hide(); $('#RestImportCsvExample_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products</span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
[ "foo", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Importing into an edge collection, with attributes `_from`, `_to` and `name`
<div class="example-container" id="RestImportCsvEdge_container">
<a class="anchorjs-link " href="#RestImportCsvEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links</span> &lt;&lt;EOF
[ "_from", "_to", "name" ]
[ "products/123","products/234", "some name" ]
[ "products/332", "products/abc", "other name" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestImportCsvEdge_container_collapse" onclick="$('#RestImportCsvEdge_long').hide(); $('#RestImportCsvEdge_short').show(); window.location.hash='RestImportCsvEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvEdge_short" onclick="$('#RestImportCsvEdge_short').hide(); $('#RestImportCsvEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links</span> &lt;&lt;EOF
[ "_from", "_to", "name" ]
[ "products/123","products/234", "some name" ]
[ "products/332", "products/abc", "other name" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Importing into an edge collection, omitting `_from` or `_to`
<div class="example-container" id="RestImportCsvEdgeInvalid_container">
<a class="anchorjs-link " href="#RestImportCsvEdgeInvalid_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvEdgeInvalid_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[ "name" ]
[ "some name" ]
[ "other name" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"details"</span> : [
<span class="hljs-string">"at position 1: missing '_from' or '_to' attribute, offending document: {\"name\":\"some name\"}"</span>,
<span class="hljs-string">"at position 2: missing '_from' or '_to' attribute, offending document: {\"name\":\"other name\"}"</span>
]
}
</pre>
<div id="RestImportCsvEdgeInvalid_container_collapse" onclick="$('#RestImportCsvEdgeInvalid_long').hide(); $('#RestImportCsvEdgeInvalid_short').show(); window.location.hash='RestImportCsvEdgeInvalid_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvEdgeInvalid_short" onclick="$('#RestImportCsvEdgeInvalid_short').hide(); $('#RestImportCsvEdgeInvalid_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[ "name" ]
[ "some name" ]
[ "other name" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Violating a unique constraint, but allow partial imports
<div class="example-container" id="RestImportCsvUniqueContinue_container">
<a class="anchorjs-link " href="#RestImportCsvUniqueContinue_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvUniqueContinue_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
["abc", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"details"</span> : [
<span class="hljs-string">"at position 1: creating document failed with error 'unique constraint violated', offending document: {\"_key\":\"abc\",\"value1\":\"bar\",\"value2\":\"baz\"}"</span>
]
}
</pre>
<div id="RestImportCsvUniqueContinue_container_collapse" onclick="$('#RestImportCsvUniqueContinue_long').hide(); $('#RestImportCsvUniqueContinue_short').show(); window.location.hash='RestImportCsvUniqueContinue_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvUniqueContinue_short" onclick="$('#RestImportCsvUniqueContinue_short').hide(); $('#RestImportCsvUniqueContinue_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
["abc", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Violating a unique constraint, not allowing partial imports
<div class="example-container" id="RestImportCsvUniqueFail_container">
<a class="anchorjs-link " href="#RestImportCsvUniqueFail_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvUniqueFail_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;complete=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
["abc", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Conflict
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">409</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"unique constraint violated"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1210</span>
}
</pre>
<div id="RestImportCsvUniqueFail_container_collapse" onclick="$('#RestImportCsvUniqueFail_long').hide(); $('#RestImportCsvUniqueFail_short').show(); window.location.hash='RestImportCsvUniqueFail_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvUniqueFail_short" onclick="$('#RestImportCsvUniqueFail_short').hide(); $('#RestImportCsvUniqueFail_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;complete=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
["abc", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Conflict
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a non-existing collection
<div class="example-container" id="RestImportCsvInvalidCollection_container">
<a class="anchorjs-link " href="#RestImportCsvInvalidCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvInvalidCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products</span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
["foo", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found: products"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestImportCsvInvalidCollection_container_collapse" onclick="$('#RestImportCsvInvalidCollection_long').hide(); $('#RestImportCsvInvalidCollection_short').show(); window.location.hash='RestImportCsvInvalidCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvInvalidCollection_short" onclick="$('#RestImportCsvInvalidCollection_short').hide(); $('#RestImportCsvInvalidCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products</span> &lt;&lt;EOF
[ "_key", "value1", "value2" ]
[ "abc", 25, "test" ]
["foo", "bar", "baz" ]
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a malformed body
<div class="example-container" id="RestImportCsvInvalidBody_container">
<a class="anchorjs-link " href="#RestImportCsvInvalidBody_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportCsvInvalidBody_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products</span> &lt;&lt;EOF
{ "_key": "foo", "value1": "bar" }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"no JSON array found in second line"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">400</span>
}
</pre>
<div id="RestImportCsvInvalidBody_container_collapse" onclick="$('#RestImportCsvInvalidBody_long').hide(); $('#RestImportCsvInvalidBody_short').show(); window.location.hash='RestImportCsvInvalidBody_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportCsvInvalidBody_short" onclick="$('#RestImportCsvInvalidBody_short').hide(); $('#RestImportCsvInvalidBody_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products</span> &lt;&lt;EOF
{ "_key": "foo", "value1": "bar" }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Bulk/post_api_export.md -->
@startDocuBlock post_api_export
@brief export all documents from a collection, using a cursor
@RESTHEADER{POST /_api/export, Create export cursor, createCursorExport}
@RESTBODYPARAM{flush,boolean,required,}
if set to *true*, a WAL flush operation will be executed prior to the
export. The flush operation will start copying documents from the WAL to the
collection's datafiles. There will be an additional wait time of up
to *flushWait* seconds after the flush to allow the WAL collector to change
the adjusted document meta-data to point into the datafiles, too.
The default value is *false* (i.e. no flush) so most recently inserted or
updated
documents from the collection might be missing in the export.
@RESTBODYPARAM{flushWait,integer,required,int64}
maximum wait time in seconds after a flush operation. The default
value is 10. This option only has an effect when *flush* is set to *true*.
@RESTBODYPARAM{count,boolean,required,}
boolean flag that indicates whether the number of documents
in the result set should be returned in the "count" attribute of the result
(optional).
Calculating the "count" attribute might in the future have a performance
impact so this option is turned off by default, and "count" is only returned
when requested.
@RESTBODYPARAM{batchSize,integer,required,int64}
maximum number of result documents to be transferred from
the server to the client in one roundtrip (optional). If this attribute is
not set, a server-controlled default value will be used.
@RESTBODYPARAM{limit,integer,required,int64}
an optional limit value, determining the maximum number of documents to
be included in the cursor. Omitting the *limit* attribute or setting it to 0 will
lead to no limit being used. If a limit is used, it is undefined which documents
from the collection will be included in the export and which will be excluded.
This is because there is no natural order of documents in a collection.
@RESTBODYPARAM{ttl,integer,required,int64}
an optional time-to-live for the cursor (in seconds). The cursor will be
removed on the server automatically after the specified amount of time. This
is useful to ensure garbage collection of cursors that are not fully fetched
by clients. If not set, a server-defined value will be used.
@RESTBODYPARAM{restrict,object,optional,post_api_export_restrictions}
an object containing an array of attribute names that will be
included or excluded when returning result documents.
Not specifying *restrict* will by default return all attributes of each document.
@RESTSTRUCT{type,post_api_export_restrictions,string,required,string}
has to be be set to either *include* or *exclude* depending on which you want to use
@RESTSTRUCT{fields,post_api_export_restrictions,array,required,string}
Contains an array of attribute names to *include* or *exclude*. Matching of attribute names
for *inclusion* or *exclusion* will be done on the top level only.
Specifying names of nested attributes is not supported at the moment.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,required}
The name of the collection to export.
@RESTDESCRIPTION
A call to this method creates a cursor containing all documents in the
specified collection. In contrast to other data-producing APIs, the internal
data structures produced by the export API are more lightweight, so it is
the preferred way to retrieve all documents from a collection.
Documents are returned in a similar manner as in the `/_api/cursor` REST API.
If all documents of the collection fit into the first batch, then no cursor
will be created, and the result object's *hasMore* attribute will be set to
*false*. If not all documents fit into the first batch, then the result
object's *hasMore* attribute will be set to *true*, and the *id* attribute
of the result will contain a cursor id.
The order in which the documents are returned is not specified.
By default, only those documents from the collection will be returned that are
stored in the collection's datafiles. Documents that are present in the write-ahead
log (WAL) at the time the export is run will not be exported.
To export these documents as well, the caller can issue a WAL flush request
before calling the export API or set the *flush* attribute. Setting the *flush*
option will trigger a WAL flush before the export so documents get copied from
the WAL to the collection datafiles.
If the result set can be created by the server, the server will respond with
*HTTP 201*. The body of the response will contain a JSON object with the
result set.
The returned JSON object has the following properties:
- *error*: boolean flag to indicate that an error occurred (*false*
in this case)
- *code*: the HTTP status code
- *result*: an array of result documents (might be empty if the collection was empty)
- *hasMore*: a boolean indicator whether there are more results
available for the cursor on the server
- *count*: the total number of result documents available (only
available if the query was executed with the *count* attribute set)
- *id*: id of temporary cursor created on the server (optional, see above)
If the JSON representation is malformed or the query specification is
missing from the request, the server will respond with *HTTP 400*.
The body of the response will contain a JSON object with additional error
details. The object has the following attributes:
- *error*: boolean flag to indicate that an error occurred (*true* in this case)
- *code*: the HTTP status code
- *errorNum*: the server error number
- *errorMessage*: a descriptive error message
Clients should always delete an export cursor result as early as possible because a
lingering export cursor will prevent the underlying collection from being
compacted or unloaded. By default, unused cursors will be deleted automatically
after a server-defined idle time, and clients can adjust this idle time by setting
the *ttl* value.
Note: this API is currently not supported on cluster coordinators.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the result set can be created by the server.
@RESTRETURNCODE{400}
is returned if the JSON representation is malformed or the query specification is
missing from the request.
@RESTRETURNCODE{404}
The server will respond with *HTTP 404* in case a non-existing collection is
accessed in the query.
@RESTRETURNCODE{405}
The server will respond with *HTTP 405* if an unsupported HTTP method is used.
@RESTRETURNCODE{501}
The server will respond with *HTTP 501* if this API is called on a cluster
coordinator.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Bulk/batch_processing.md -->
@startDocuBlock batch_processing
@brief executes a batch request
@RESTHEADER{POST /_api/batch,executes a batch request, RestBatchHandler} TODOSWAGGER: contentype
@RESTALLBODYPARAM{body,string,required}
The multipart batch request, consisting of the envelope and the individual
batch parts.
@RESTDESCRIPTION
Executes a batch request. A batch request can contain any number of
other requests that can be sent to ArangoDB in isolation. The benefit of
using batch requests is that batching requests requires less client/server
roundtrips than when sending isolated requests.
All parts of a batch request are executed serially on the server. The
server will return the results of all parts in a single response when all
parts are finished.
Technically, a batch request is a multipart HTTP request, with
content-type `multipart/form-data`. A batch request consists of an
envelope and the individual batch part actions. Batch part actions
are "regular" HTTP requests, including full header and an optional body.
Multiple batch parts are separated by a boundary identifier. The
boundary identifier is declared in the batch envelope. The MIME content-type
for each individual batch part must be `application/x-arango-batchpart`.
Please note that when constructing the individual batch parts, you must
use CRLF (`\r\n`) as the line terminator as in regular HTTP messages.
The response sent by the server will be an `HTTP 200` response, with an
optional error summary header `x-arango-errors`. This header contains the
number of batch part operations that failed with an HTTP error code of at
least 400. This header is only present in the response if the number of
errors is greater than zero.
The response sent by the server is a multipart response, too. It contains
the individual HTTP responses for all batch parts, including the full HTTP
result header (with status code and other potential headers) and an
optional result body. The individual batch parts in the result are
seperated using the same boundary value as specified in the request.
The order of batch parts in the response will be the same as in the
original client request. Client can additionally use the `Content-Id`
MIME header in a batch part to define an individual id for each batch part.
The server will return this id is the batch part responses, too.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the batch was received successfully. HTTP 200 is returned
even if one or multiple batch part actions failed.
@RESTRETURNCODE{400}
is returned if the batch envelope is malformed or incorrectly formatted.
This code will also be returned if the content-type of the overall batch
request or the individual MIME parts is not as expected.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@EXAMPLES
Sending a batch request with five batch parts:
- GET /_api/version
- DELETE /_api/collection/products
- POST /_api/collection/products
- GET /_api/collection/products/figures
- DELETE /_api/collection/products
The boundary (`SomeBoundaryValue`) is passed to the server in the HTTP
`Content-Type` HTTP header.
*Please note the reply is not displayed all accurate.*
<div class="example-container" id="RestBatchMultipartHeader_container">
<a class="anchorjs-link " href="#RestBatchMultipartHeader_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBatchMultipartHeader_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'Content-Type: multipart/form-data; boundary=SomeBoundaryValue'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/batch</span> &lt;&lt;EOF
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId1
GET /_api/version HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId2
DELETE /_api/collection/products HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: someId
POST /_api/collection/products HTTP/1.1
{"name": "products" }
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: nextId
GET /_api/collection/products/figures HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: otherId
DELETE /_api/collection/products HTTP/1.1
--SomeBoundaryValue--
EOF
HTTP/1.1 OK
content-type: application/json
x-arango-errors: 1
x-content-type-options: nosniff
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId1
HTTP/1.1 200 OK
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 60
{
<span class="hljs-string">"server"</span> : <span class="hljs-string">"arango"</span>,
<span class="hljs-string">"license"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>
}&#x21A9;
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId2
HTTP/1.1 404 Not Found
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 87
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}&#x21A9;
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: someId
HTTP/1.1 200 OK
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 290
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69088"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69087"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69088"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>
}&#x21A9;
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: nextId
HTTP/1.1 200 OK
Server:
Location: /_api/collection/products/figures
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 409
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69087"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"figures"</span> : {
<span class="hljs-string">"indexes"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"documentsSize"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"cacheInUse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cacheSize"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"cacheUsage"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69088"</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69088"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>
}&#x21A9;
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: otherId
HTTP/1.1 200 OK
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 39
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69088"</span>
}&#x21A9;
--SomeBoundaryValue--
</pre>
<div id="RestBatchMultipartHeader_container_collapse" onclick="$('#RestBatchMultipartHeader_long').hide(); $('#RestBatchMultipartHeader_short').show(); window.location.hash='RestBatchMultipartHeader_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBatchMultipartHeader_short" onclick="$('#RestBatchMultipartHeader_short').hide(); $('#RestBatchMultipartHeader_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'Content-Type: multipart/form-data; boundary=SomeBoundaryValue'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/batch</span> &lt;&lt;EOF
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId1
GET /_api/version HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId2
DELETE /_api/collection/products HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: someId
POST /_api/collection/products HTTP/1.1
{"name": "products" }
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: nextId
GET /_api/collection/products/figures HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: otherId
DELETE /_api/collection/products HTTP/1.1
--SomeBoundaryValue--
EOF
HTTP/1.1 OK
content-type: application/json
x-arango-errors: 1
x-content-type-options: nosniff
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
Content-Id: myId1
HTTP/1.1 200 OK
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 60
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Sending a batch request, setting the boundary implicitly (the server will
in this case try to find the boundary at the beginning of the request body).
<div class="example-container" id="RestBatchImplicitBoundary_container">
<a class="anchorjs-link " href="#RestBatchImplicitBoundary_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestBatchImplicitBoundary_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/batch</span> &lt;&lt;EOF
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
DELETE /_api/collection/notexisting1 HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
DELETE _api/collection/notexisting2 HTTP/1.1
--SomeBoundaryValue--
EOF
HTTP/1.1 OK
content-type: application/json
x-arango-errors: 2
x-content-type-options: nosniff
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
HTTP/1.1 404 Not Found
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 87
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}&#x21A9;
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
HTTP/1.1 404 Not Found
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 101
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"unknown path '_api/collection/notexisting2'"</span>
}&#x21A9;
--SomeBoundaryValue--
</pre>
<div id="RestBatchImplicitBoundary_container_collapse" onclick="$('#RestBatchImplicitBoundary_long').hide(); $('#RestBatchImplicitBoundary_short').show(); window.location.hash='RestBatchImplicitBoundary_container';" class="example_show_button">Hide response body</div></div>
<div id="RestBatchImplicitBoundary_short" onclick="$('#RestBatchImplicitBoundary_short').hide(); $('#RestBatchImplicitBoundary_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/batch</span> &lt;&lt;EOF
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
DELETE /_api/collection/notexisting1 HTTP/1.1
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
DELETE _api/collection/notexisting2 HTTP/1.1
--SomeBoundaryValue--
EOF
HTTP/1.1 OK
content-type: application/json
x-arango-errors: 2
x-content-type-options: nosniff
--SomeBoundaryValue
Content-Type: application/x-arango-batchpart
HTTP/1.1 404 Not Found
Server:
Connection:
Content-Type: application/json; charset=utf-8
Content-Length: 87
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Bulk/import_json.md -->
@startDocuBlock import_json
@brief imports documents from JSON
@RESTHEADER{POST /_api/import#json,imports documents from JSON, RestImportHandler}
@RESTALLBODYPARAM{documents,string,required}
The body must either be a JSON-encoded array of objects or a string with
multiple JSON objects separated by newlines.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{type,string,required}
Determines how the body of the request will be interpreted. `type` can have
the following values:
- `documents`: when this type is used, each line in the request body is
expected to be an individual JSON-encoded document. Multiple JSON objects
in the request body need to be separated by newlines.
- `list`: when this type is used, the request body must contain a single
JSON-encoded array of individual objects to import.
- `auto`: if set, this will automatically determine the body type (either
`documents` or `list`).
@RESTQUERYPARAM{collection,string,required}
The collection name.
@RESTQUERYPARAM{fromPrefix,string,optional}
An optional prefix for the values in `_from` attributes. If specified, the
value is automatically prepended to each `_from` input value. This allows
specifying just the keys for `_from`.
@RESTQUERYPARAM{toPrefix,string,optional}
An optional prefix for the values in `_to` attributes. If specified, the
value is automatically prepended to each `_to` input value. This allows
specifying just the keys for `_to`.
@RESTQUERYPARAM{overwrite,boolean,optional}
If this parameter has a value of `true` or `yes`, then all data in the
collection will be removed prior to the import. Note that any existing
index definitions will be preseved.
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until documents have been synced to disk before returning.
@RESTQUERYPARAM{onDuplicate,string,optional}
Controls what action is carried out in case of a unique key constraint
violation. Possible values are:
- *error*: this will not import the current document because of the unique
key constraint violation. This is the default setting.
- *update*: this will update an existing document in the database with the
data specified in the request. Attributes of the existing document that
are not present in the request will be preseved.
- *replace*: this will replace an existing document in the database with the
data specified in the request.
- *ignore*: this will not update an existing document and simply ignore the
error caused by a unique key constraint violation.
Note that that *update*, *replace* and *ignore* will only work when the
import document in the request contains the *_key* attribute. *update* and
*replace* may also fail because of secondary unique key constraint violations.
@RESTQUERYPARAM{complete,boolean,optional}
If set to `true` or `yes`, it will make the whole import fail if any error
occurs. Otherwise the import will continue even if some documents cannot
be imported.
@RESTQUERYPARAM{details,boolean,optional}
If set to `true` or `yes`, the result will include an attribute `details`
with details about documents that could not be imported.
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates documents in the collection identified by `collection-name`.
The JSON representations of the documents must be passed as the body of the
POST request. The request body can either consist of multiple lines, with
each line being a single stand-alone JSON object, or a singe JSON array with
sub-objects.
The response is a JSON object with the following attributes:
- `created`: number of documents imported.
- `errors`: number of documents that were not imported due to an error.
- `empty`: number of empty lines found in the input (will only contain a
value greater zero for types `documents` or `auto`).
- `updated`: number of updated/replaced documents (in case `onDuplicate`
was set to either `update` or `replace`).
- `ignored`: number of failed but ignored insert operations (in case
`onDuplicate` was set to `ignore`).
- `details`: if query parameter `details` is set to true, the result will
contain a `details` attribute which is an array with more detailed
information about which documents could not be inserted.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if all documents could be imported successfully.
@RESTRETURNCODE{400}
is returned if `type` contains an invalid value, no `collection` is
specified, the documents are incorrectly encoded, or the request
is malformed.
@RESTRETURNCODE{404}
is returned if `collection` or the `_from` or `_to` attributes of an
imported edge refer to an unknown collection.
@RESTRETURNCODE{409}
is returned if the import would trigger a unique key violation and
`complete` is set to `true`.
@RESTRETURNCODE{500}
is returned if the server cannot auto-generate a document key (out of keys
error) for a document with no user-defined key.
@EXAMPLES
Importing documents with heterogenous attributes from a JSON array
<div class="example-container" id="RestImportJsonList_container">
<a class="anchorjs-link " href="#RestImportJsonList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonList_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=list</span> &lt;&lt;EOF
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"abc"</span>,
<span class="hljs-string">"value1"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"value2"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"allowed"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"foo"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"baz"</span>
},
{
<span class="hljs-string">"name"</span> : {
<span class="hljs-string">"detailed"</span> : <span class="hljs-string">"detailed name"</span>,
<span class="hljs-string">"short"</span> : <span class="hljs-string">"short name"</span>
}
}
]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestImportJsonList_container_collapse" onclick="$('#RestImportJsonList_long').hide(); $('#RestImportJsonList_short').show(); window.location.hash='RestImportJsonList_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonList_short" onclick="$('#RestImportJsonList_short').hide(); $('#RestImportJsonList_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=list</span> &lt;&lt;EOF
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"abc"</span>,
<span class="hljs-string">"value1"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"value2"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"allowed"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"foo"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"baz"</span>
},
{
<span class="hljs-string">"name"</span> : {
<span class="hljs-string">"detailed"</span> : <span class="hljs-string">"detailed name"</span>,
<span class="hljs-string">"short"</span> : <span class="hljs-string">"short name"</span>
}
}
]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Importing documents from individual JSON lines
<div class="example-container" id="RestImportJsonLines_container">
<a class="anchorjs-link " href="#RestImportJsonLines_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonLines_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents</span> &lt;&lt;EOF
{ "_key": "abc", "value1": 25, "value2": "test","allowed": true }
{ "_key": "foo", "name": "baz" }
{ "name": { "detailed": "detailed name", "short": "short name" } }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestImportJsonLines_container_collapse" onclick="$('#RestImportJsonLines_long').hide(); $('#RestImportJsonLines_short').show(); window.location.hash='RestImportJsonLines_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonLines_short" onclick="$('#RestImportJsonLines_short').hide(); $('#RestImportJsonLines_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents</span> &lt;&lt;EOF
{ "_key": "abc", "value1": 25, "value2": "test","allowed": true }
{ "_key": "foo", "name": "baz" }
{ "name": { "detailed": "detailed name", "short": "short name" } }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using the auto type detection
<div class="example-container" id="RestImportJsonType_container">
<a class="anchorjs-link " href="#RestImportJsonType_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonType_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=auto</span> &lt;&lt;EOF
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"abc"</span>,
<span class="hljs-string">"value1"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"value2"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"allowed"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"foo"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"baz"</span>
},
{
<span class="hljs-string">"name"</span> : {
<span class="hljs-string">"detailed"</span> : <span class="hljs-string">"detailed name"</span>,
<span class="hljs-string">"short"</span> : <span class="hljs-string">"short name"</span>
}
}
]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestImportJsonType_container_collapse" onclick="$('#RestImportJsonType_long').hide(); $('#RestImportJsonType_short').show(); window.location.hash='RestImportJsonType_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonType_short" onclick="$('#RestImportJsonType_short').hide(); $('#RestImportJsonType_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=auto</span> &lt;&lt;EOF
[
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"abc"</span>,
<span class="hljs-string">"value1"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"value2"</span> : <span class="hljs-string">"test"</span>,
<span class="hljs-string">"allowed"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"foo"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"baz"</span>
},
{
<span class="hljs-string">"name"</span> : {
<span class="hljs-string">"detailed"</span> : <span class="hljs-string">"detailed name"</span>,
<span class="hljs-string">"short"</span> : <span class="hljs-string">"short name"</span>
}
}
]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Importing into an edge collection, with attributes `_from`, `_to` and `name`
<div class="example-container" id="RestImportJsonEdge_container">
<a class="anchorjs-link " href="#RestImportJsonEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links&amp;<span class="hljs-built_in">type</span>=documents</span> &lt;&lt;EOF
{ "_from": "products/123", "_to": "products/234" }
{"_from": "products/332", "_to": "products/abc", "name": "other name" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestImportJsonEdge_container_collapse" onclick="$('#RestImportJsonEdge_long').hide(); $('#RestImportJsonEdge_short').show(); window.location.hash='RestImportJsonEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonEdge_short" onclick="$('#RestImportJsonEdge_short').hide(); $('#RestImportJsonEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links&amp;<span class="hljs-built_in">type</span>=documents</span> &lt;&lt;EOF
{ "_from": "products/123", "_to": "products/234" }
{"_from": "products/332", "_to": "products/abc", "name": "other name" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Importing into an edge collection, omitting `_from` or `_to`
<div class="example-container" id="RestImportJsonEdgeInvalid_container">
<a class="anchorjs-link " href="#RestImportJsonEdgeInvalid_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonEdgeInvalid_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links&amp;<span class="hljs-built_in">type</span>=list&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"some name"</span>
}
]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"details"</span> : [
<span class="hljs-string">"at position 1: missing '_from' or '_to' attribute, offending document: {\"name\":\"some name\"}"</span>
]
}
</pre>
<div id="RestImportJsonEdgeInvalid_container_collapse" onclick="$('#RestImportJsonEdgeInvalid_long').hide(); $('#RestImportJsonEdgeInvalid_short').show(); window.location.hash='RestImportJsonEdgeInvalid_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonEdgeInvalid_short" onclick="$('#RestImportJsonEdgeInvalid_short').hide(); $('#RestImportJsonEdgeInvalid_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=links&amp;<span class="hljs-built_in">type</span>=list&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
[
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"some name"</span>
}
]
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Violating a unique constraint, but allow partial imports
<div class="example-container" id="RestImportJsonUniqueContinue_container">
<a class="anchorjs-link " href="#RestImportJsonUniqueContinue_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonUniqueContinue_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "_key": "abc", "value1": 25, "value2": "test" }
{ "_key": "abc", "value1": "bar", "value2": "baz" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"errors"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"updated"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"details"</span> : [
<span class="hljs-string">"at position 1: creating document failed with error 'unique constraint violated', offending document: {\"_key\":\"abc\",\"value1\":\"bar\",\"value2\":\"baz\"}"</span>
]
}
</pre>
<div id="RestImportJsonUniqueContinue_container_collapse" onclick="$('#RestImportJsonUniqueContinue_long').hide(); $('#RestImportJsonUniqueContinue_short').show(); window.location.hash='RestImportJsonUniqueContinue_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonUniqueContinue_short" onclick="$('#RestImportJsonUniqueContinue_short').hide(); $('#RestImportJsonUniqueContinue_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents&amp;details=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "_key": "abc", "value1": 25, "value2": "test" }
{ "_key": "abc", "value1": "bar", "value2": "baz" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Violating a unique constraint, not allowing partial imports
<div class="example-container" id="RestImportJsonUniqueFail_container">
<a class="anchorjs-link " href="#RestImportJsonUniqueFail_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonUniqueFail_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents&amp;complete=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "_key": "abc", "value1": 25, "value2": "test" }
{ "_key": "abc", "value1": "bar", "value2": "baz" }
EOF
HTTP/<span class="hljs-number">1.1</span> Conflict
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">409</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"unique constraint violated"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1210</span>
}
</pre>
<div id="RestImportJsonUniqueFail_container_collapse" onclick="$('#RestImportJsonUniqueFail_long').hide(); $('#RestImportJsonUniqueFail_short').show(); window.location.hash='RestImportJsonUniqueFail_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonUniqueFail_short" onclick="$('#RestImportJsonUniqueFail_short').hide(); $('#RestImportJsonUniqueFail_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents&amp;complete=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "_key": "abc", "value1": 25, "value2": "test" }
{ "_key": "abc", "value1": "bar", "value2": "baz" }
EOF
HTTP/<span class="hljs-number">1.1</span> Conflict
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a non-existing collection
<div class="example-container" id="RestImportJsonInvalidCollection_container">
<a class="anchorjs-link " href="#RestImportJsonInvalidCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonInvalidCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents</span> &lt;&lt;EOF
{ "name": "test" }
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found: products"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestImportJsonInvalidCollection_container_collapse" onclick="$('#RestImportJsonInvalidCollection_long').hide(); $('#RestImportJsonInvalidCollection_short').show(); window.location.hash='RestImportJsonInvalidCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonInvalidCollection_short" onclick="$('#RestImportJsonInvalidCollection_short').hide(); $('#RestImportJsonInvalidCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=documents</span> &lt;&lt;EOF
{ "name": "test" }
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a malformed body
<div class="example-container" id="RestImportJsonInvalidBody_container">
<a class="anchorjs-link " href="#RestImportJsonInvalidBody_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestImportJsonInvalidBody_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=list</span> &lt;&lt;EOF
{ }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"expecting a JSON array in the request"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">400</span>
}
</pre>
<div id="RestImportJsonInvalidBody_container_collapse" onclick="$('#RestImportJsonInvalidBody_long').hide(); $('#RestImportJsonInvalidBody_short').show(); window.location.hash='RestImportJsonInvalidBody_container';" class="example_show_button">Hide response body</div></div>
<div id="RestImportJsonInvalidBody_short" onclick="$('#RestImportJsonInvalidBody_short').hide(); $('#RestImportJsonInvalidBody_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/import?collection=products&amp;<span class="hljs-built_in">type</span>=list</span> &lt;&lt;EOF
{ }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Cluster/put_cluster_maintenance.md -->
@startDocuBlock put_cluster_maintenance
@brief Enable or disable the cluster supervision (agency) maintenance mode
@RESTHEADER{PUT /_admin/cluster/maintenance, Enable or disable the supervision maintenance mode}
@RESTDESCRIPTION
This API allows you to temporarily enable the supervision maintenance mode. Be aware that no
automatic failovers of any kind will take place while the maintenance mode is enabled.
The _cluster_ supervision reactivates itself automatically _60 minutes_ after disabling it.
To enable the maintenance mode the request body must contain the string `"on"`. To disable it, send the string
`"off"` (Please note it _must_ be lowercase as well as include the quotes).
@RESTRETURNCODES
@RESTRETURNCODE{200} is returned when everything went well.
@RESTRETURNCODE{400} if the request contained an invalid body
@RESTRETURNCODE{501} if the request was sent to a node other than a coordinator or single-server
@RESTRETURNCODE{504} if the request timed out while enabling the maintenance mode
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Cluster/get_cluster_health.md -->
@startDocuBlock get_cluster_health
@brief Returns the health of the cluster as assessed by the supervision (agency)
@RESTHEADER{GET /_admin/cluster/health, Queries the health of cluster for monitoring}
@RESTDESCRIPTION
Queries the health of the cluster for monitoring purposes. The response is a JSON object, containing the standard `code`, `error`, `errorNum`, and `errorMessage` fields as appropriate. The endpoint-specific fields are as follows:
- `ClusterId`: A UUID string identifying the cluster
- `Health`: An object containing a descriptive sub-object for each node in the cluster.
- `<nodeID>`: Each entry in `Health` will be keyed by the node ID and contain the following attributes:
- `Endpoint`: A string representing the network endpoint of the server.
- `Role`: The role the server plays. Possible values are `"AGENT"`, `"COORDINATOR"`, and `"DBSERVER"`.
- `CanBeDeleted`: Boolean representing whether the node can safely be removed from the cluster.
- `Version`: Version String of ArangoDB used by that node.
- `Engine`: Storage Engine used by that node.
- `Status`: A string indicating the health of the node as assessed by the supervision (agency). This should be considered primary source of truth for coordinator and dbservers node health. If the node is responding normally to requests, it is `"GOOD"`. If it has missed one heartbeat, it is `"BAD"`. If it has been declared failed by the supervision, which occurs after missing heartbeats for about 15 seconds, it will be marked `"FAILED"`.
Additionally it will also have the following attributes for:
**Coordinators** and **DBServers**
- `SyncStatus`: The last sync status reported by the node. This value is primarily used to determine the value of `Status`. Possible values include `"UNKNOWN"`, `"UNDEFINED"`, `"STARTUP"`, `"STOPPING"`, `"STOPPED"`, `"SERVING"`, `"SHUTDOWN"`.
- `LastAckedTime`: ISO 8601 timestamp specifying the last heartbeat received.
- `ShortName`: A string representing the shortname of the server, e.g. `"Coordinator0001"`.
- `Timestamp`: ISO 8601 timestamp specifying the last heartbeat received. (deprecated)
- `Host`: An optional string, specifying the host machine if known.
**Coordinators** only
- `AdvertisedEndpoint`: A string representing the advertised endpoint, if set. (e.g. external IP address or load balancer, optional)
**Agents**
- `Leader`: ID of the agent this node regards as leader.
- `Leading`: Whether this agent is the leader (true) or not (false).
- `LastAckedTime`: Time since last `acked` in seconds.
@RESTRETURNCODES
@RESTRETURNCODE{200} is returned when everything went well.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Cluster/get_cluster_statistics.md -->
@startDocuBlock get_cluster_statistics
@brief allows to query the statistics of a DBserver in the cluster
@RESTHEADER{GET /_admin/clusterStatistics, Queries statistics of DBserver}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{DBserver,string,required}
@RESTDESCRIPTION
Queries the statistics of the given DBserver
@RESTRETURNCODES
@RESTRETURNCODE{200} is returned when everything went well.
@RESTRETURNCODE{400} the parameter DBserver was not given or is not the
ID of a DBserver
@RESTRETURNCODE{403} server is not a coordinator.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/job/job_getStatusById.md -->
@startDocuBlock job_getStatusById
@brief Returns the status of a specific job
@RESTHEADER{GET /_api/job/{job-id}, Returns async job, getJobById}
@RESTURLPARAMETERS
@RESTURLPARAM{job-id,string,required}
The async job id.
@RESTDESCRIPTION
Returns the processing status of the specified job. The processing status
can be
determined by peeking into the HTTP response code of the response.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the job requested via job-id has been executed
and its result is ready to fetch.
@RESTRETURNCODE{204}
is returned if the job requested via job-id is still in the queue of pending
(or not yet finished) jobs.
@RESTRETURNCODE{404}
is returned if the job was not found or already deleted or fetched from the
job result list.
@EXAMPLES
Querying the status of a done job:
<div class="example-container" id="job_getStatusById_01_container">
<a class="anchorjs-link " href="#job_getStatusById_01_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_getStatusById_01_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88531
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88531</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-arango-<span class="hljs-keyword">async</span>-id: <span class="hljs-number">88531</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"server"</span> : <span class="hljs-string">"arango"</span>,
<span class="hljs-string">"license"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>
}
</pre>
<div id="job_getStatusById_01_container_collapse" onclick="$('#job_getStatusById_01_long').hide(); $('#job_getStatusById_01_short').show(); window.location.hash='job_getStatusById_01_container';" class="example_show_button">Hide response body</div></div>
<div id="job_getStatusById_01_short" onclick="$('#job_getStatusById_01_short').hide(); $('#job_getStatusById_01_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88531
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88531</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-arango-<span class="hljs-keyword">async</span>-id: <span class="hljs-number">88531</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Querying the status of a pending job:
(therefore we create a long runnging job...)
<div class="example-container" id="job_getStatusById_02_container">
<a class="anchorjs-link " href="#job_getStatusById_02_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_getStatusById_02_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : [
<span class="hljs-string">"_aqlfunctions"</span>
]
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () {require('internal').sleep(15.0);}"</span>
}
EOF
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88533
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88533</span>
HTTP/1.1 No Content
content-type: text/plain; charset=utf-8
x-content-type-options: nosniff
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/job/job_delete.md -->
@startDocuBlock job_delete
@brief deletes an async job result
@RESTHEADER{DELETE /_api/job/{type}, Deletes async job, deleteJob:byType}
@RESTURLPARAMETERS
@RESTURLPARAM{type,string,required}
The type of jobs to delete. type can be:
* *all*: Deletes all jobs results. Currently executing or queued async
jobs will not be stopped by this call.
* *expired*: Deletes expired results. To determine the expiration status of a
result, pass the stamp query parameter. stamp needs to be a UNIX timestamp,
and all async job results created at a lower timestamp will be deleted.
* *an actual job-id*: In this case, the call will remove the result of the
specified async job. If the job is currently executing or queued, it will
not be aborted.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{stamp,number,optional}
A UNIX timestamp specifying the expiration threshold when type is expired.
@RESTDESCRIPTION
Deletes either all job results, expired job results, or the result of a
specific job.
Clients can use this method to perform an eventual garbage collection of job
results.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the deletion operation was carried out successfully.
This code will also be returned if no results were deleted.
@RESTRETURNCODE{400}
is returned if type is not specified or has an invalid value.
@RESTRETURNCODE{404}
is returned if type is a job-id but no async job with the specified id was
found.
@EXAMPLES
Deleting all jobs:
<div class="example-container" id="job_delete_01_container">
<a class="anchorjs-link " href="#job_delete_01_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_delete_01_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88511
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/all</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
</div>
</div>
Deleting expired jobs:
<div class="example-container" id="job_delete_02_container">
<a class="anchorjs-link " href="#job_delete_02_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_delete_02_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88513
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/time</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"time"</span> : <span class="hljs-number">1570112308.6467333</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/expired?stamp=1570112308.6467333</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/pending</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[ ]
</pre>
<div id="job_delete_02_container_collapse" onclick="$('#job_delete_02_long').hide(); $('#job_delete_02_short').show(); window.location.hash='job_delete_02_container';" class="example_show_button">Hide response body</div></div>
<div id="job_delete_02_short" onclick="$('#job_delete_02_short').hide(); $('#job_delete_02_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88513
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/time</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/expired?stamp=1570112308.6467333</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/pending</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[ ]
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Deleting the result of a specific job:
<div class="example-container" id="job_delete_03_container">
<a class="anchorjs-link " href="#job_delete_03_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_delete_03_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88515
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88515</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
</div>
</div>
Deleting the result of a non-existing job:
<div class="example-container" id="job_delete_04_container">
<a class="anchorjs-link " href="#job_delete_04_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_delete_04_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/AreYouThere</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">404</span>
}
</pre>
<div id="job_delete_04_container_collapse" onclick="$('#job_delete_04_long').hide(); $('#job_delete_04_short').show(); window.location.hash='job_delete_04_container';" class="example_show_button">Hide response body</div></div>
<div id="job_delete_04_short" onclick="$('#job_delete_04_short').hide(); $('#job_delete_04_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/AreYouThere</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/job/job_getByType.md -->
@startDocuBlock job_getByType
@brief Returns the ids of job results with a specific status
@RESTHEADER{GET /_api/job/{type}, Returns list of async jobs, getJob}
@RESTURLPARAMETERS
@RESTURLPARAM{type,string,required}
The type of jobs to return. The type can be either done or pending. Setting
the type to done will make the method return the ids of already completed
async
jobs for which results can be fetched. Setting the type to pending will
return
the ids of not yet finished async jobs.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{count,number,optional}
The maximum number of ids to return per call. If not specified, a
server-defined maximum value will be used.
@RESTDESCRIPTION
Returns the list of ids of async jobs with a specific status (either done or
pending).
The list can be used by the client to get an overview of the job system
status and
to retrieve completed job results later.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the list can be compiled successfully. Note: the list might
be empty.
@RESTRETURNCODE{400}
is returned if type is not specified or has an invalid value.
@EXAMPLES
Fetching the list of done jobs:
<div class="example-container" id="job_getByType_01_container">
<a class="anchorjs-link " href="#job_getByType_01_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_getByType_01_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88524
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/<span class="hljs-keyword">done</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
<span class="hljs-string">"88524"</span>
]
</pre>
</div>
</div>
Fetching the list of pending jobs:
<div class="example-container" id="job_getByType_02_container">
<a class="anchorjs-link " href="#job_getByType_02_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_getByType_02_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88526
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/pending</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[ ]
</pre>
</div>
</div>
Querying the status of a pending job:
(we create a sleep job therefore...)
<div class="example-container" id="job_getByType_03_container">
<a class="anchorjs-link " href="#job_getByType_03_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_getByType_03_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : [
<span class="hljs-string">"_frontend"</span>
]
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () {require('internal').sleep(15.0);}"</span>
}
EOF
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88528
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/pending</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
<span class="hljs-string">"88528"</span>
]
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88528</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/job/job_fetch_result.md -->
@startDocuBlock job_fetch_result
@brief fetches a job result and removes it from the queue
@RESTHEADER{PUT /_api/job/{job-id}, Return result of an async job, getJobResult}
@RESTURLPARAMETERS
@RESTURLPARAM{job-id,string,required}
The async job id.
@RESTDESCRIPTION
Returns the result of an async job identified by job-id. If the async job
result is present on the server, the result will be removed from the list of
result. That means this method can be called for each job-id once.
The method will return the original job result's headers and body, plus the
additional HTTP header x-arango-async-job-id. If this header is present,
then
the job was found and the response contains the original job's result. If
the header is not present, the job was not found and the response contains
status information from the job manager.
@RESTRETURNCODES
@RESTRETURNCODE{204}
is returned if the job requested via job-id is still in the queue of pending
(or not yet finished) jobs. In this case, no x-arango-async-id HTTP header
will be returned.
@RESTRETURNCODE{400}
is returned if no job-id was specified in the request. In this case,
no x-arango-async-id HTTP header will be returned.
@RESTRETURNCODE{404}
is returned if the job was not found or already deleted or fetched from
the job result list. In this case, no x-arango-async-id HTTP header will
be returned.
@EXAMPLES
Not providing a job-id:
<div class="example-container" id="job_fetch_result_01_container">
<a class="anchorjs-link " href="#job_fetch_result_01_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_fetch_result_01_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"bad parameter"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">400</span>
}
</pre>
<div id="job_fetch_result_01_container_collapse" onclick="$('#job_fetch_result_01_long').hide(); $('#job_fetch_result_01_short').show(); window.location.hash='job_fetch_result_01_container';" class="example_show_button">Hide response body</div></div>
<div id="job_fetch_result_01_short" onclick="$('#job_fetch_result_01_short').hide(); $('#job_fetch_result_01_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Providing a job-id for a non-existing job:
<div class="example-container" id="job_fetch_result_02_container">
<a class="anchorjs-link " href="#job_fetch_result_02_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_fetch_result_02_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/notthere</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">404</span>
}
</pre>
<div id="job_fetch_result_02_container_collapse" onclick="$('#job_fetch_result_02_long').hide(); $('#job_fetch_result_02_short').show(); window.location.hash='job_fetch_result_02_container';" class="example_show_button">Hide response body</div></div>
<div id="job_fetch_result_02_short" onclick="$('#job_fetch_result_02_short').hide(); $('#job_fetch_result_02_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/notthere</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Fetching the result of an HTTP GET job:
<div class="example-container" id="job_fetch_result_03_container">
<a class="anchorjs-link " href="#job_fetch_result_03_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_fetch_result_03_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88520
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88520</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-arango-<span class="hljs-keyword">async</span>-id: <span class="hljs-number">88520</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"server"</span> : <span class="hljs-string">"arango"</span>,
<span class="hljs-string">"license"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>
}
</pre>
<div id="job_fetch_result_03_container_collapse" onclick="$('#job_fetch_result_03_long').hide(); $('#job_fetch_result_03_short').show(); window.location.hash='job_fetch_result_03_container';" class="example_show_button">Hide response body</div></div>
<div id="job_fetch_result_03_short" onclick="$('#job_fetch_result_03_short').hide(); $('#job_fetch_result_03_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88520
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88520</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-arango-<span class="hljs-keyword">async</span>-id: <span class="hljs-number">88520</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Fetching the result of an HTTP POST job that failed:
<div class="example-container" id="job_fetch_result_04_container">
<a class="anchorjs-link " href="#job_fetch_result_04_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_fetch_result_04_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">" this name is invalid "</span>
}
EOF
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88522
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88522</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-arango-<span class="hljs-keyword">async</span>-id: <span class="hljs-number">88522</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"expected PUT /_api/collection/&lt;collection-name&gt;/&lt;action&gt;"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">400</span>
}
</pre>
<div id="job_fetch_result_04_container_collapse" onclick="$('#job_fetch_result_04_long').hide(); $('#job_fetch_result_04_short').show(); window.location.hash='job_fetch_result_04_container';" class="example_show_button">Hide response body</div></div>
<div id="job_fetch_result_04_short" onclick="$('#job_fetch_result_04_short').hide(); $('#job_fetch_result_04_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">" this name is invalid "</span>
}
EOF
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88522
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88522</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-arango-<span class="hljs-keyword">async</span>-id: <span class="hljs-number">88522</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/job/job_cancel.md -->
@startDocuBlock job_cancel
@brief cancels an async job
@RESTHEADER{PUT /_api/job/{job-id}/cancel, Cancel async job, putJobMethod:cancel}
@RESTURLPARAMETERS
@RESTURLPARAM{job-id,string,required}
The async job id.
@RESTDESCRIPTION
Cancels the currently running job identified by job-id. Note that it still
might take some time to actually cancel the running async job.
@RESTRETURNCODES
@RESTRETURNCODE{200}
cancel has been initiated.
@RESTRETURNCODE{400}
is returned if no job-id was specified in the request. In this case,
no x-arango-async-id HTTP header will be returned.
@RESTRETURNCODE{404}
is returned if the job was not found or already deleted or fetched from
the job result list. In this case, no x-arango-async-id HTTP header will
be returned.
@EXAMPLES
<div class="example-container" id="job_cancel_container">
<a class="anchorjs-link " href="#job_cancel_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="job_cancel_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'x-arango-async: store'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..10 FOR j IN 1..10 LET x = sleep(1.0) FILTER i == 5 &amp;&amp; j == 5 RETURN 42"</span>
}
EOF
HTTP/1.1 Accepted
content-type: text/plain; charset=utf-8
x-arango-async-id: 88508
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/pending</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
<span class="hljs-string">"88508"</span>
]
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/88508/cancel</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/job/pending</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
<span class="hljs-string">"88508"</span>
]
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_api_return.md -->
@startDocuBlock get_api_return
@brief returns the server version number
@RESTHEADER{GET /_api/version, Return server version, RestVersionHandler}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{details,boolean,optional}
If set to *true*, the response will contain a *details* attribute with
additional information about included components and their versions. The
attribute names and internals of the *details* object may vary depending on
platform and ArangoDB version.
@RESTDESCRIPTION
Returns the server name and version number. The response is a JSON object
with the following attributes:
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned in all cases.
@RESTREPLYBODY{server,string,required,string}
will always contain *arango*
@RESTREPLYBODY{version,string,required,string}
the server version string. The string has the format
"*major*.*minor*.*sub*". *major* and *minor* will be numeric, and *sub*
may contain a number or a textual version.
@RESTREPLYBODY{details,object,optional,version_details_struct}
an optional JSON object with additional details. This is
returned only if the *details* query parameter is set to *true* in the
request.
@RESTSTRUCT{architecture,version_details_struct,string,optional,}
The CPU architecture, i.e. *64bit*
@RESTSTRUCT{arm,version_details_struct,string,optional,}
*false* - this is not running on an ARM cpu
@RESTSTRUCT{asan,version_details_struct,string,optional,}
has this been compiled with the asan address sanitizer turned on? (should be false)
@RESTSTRUCT{asm-crc32,version_details_struct,string,optional,}
do we have assembler implemented CRC functions?
@RESTSTRUCT{assertions,version_details_struct,string,optional,}
do we have assertions compiled in (=> developer version)
@RESTSTRUCT{boost-version,version_details_struct,string,optional,}
which boost version do we bind
@RESTSTRUCT{build-date,version_details_struct,string,optional,}
the date when this binary was created
@RESTSTRUCT{build-repository,version_details_struct,string,optional,}
reference to the git-ID this was compiled from
@RESTSTRUCT{compiler,version_details_struct,string,optional,}
which compiler did we use
@RESTSTRUCT{cplusplus,version_details_struct,string,optional,}
C++ standards version
@RESTSTRUCT{debug,version_details_struct,string,optional,}
*false* for production binaries
@RESTSTRUCT{endianness,version_details_struct,string,optional,}
currently only *little* is supported
@RESTSTRUCT{failure-tests,version_details_struct,string,optional,}
*false* for production binaries (the facility to invoke fatal errors is disabled)
@RESTSTRUCT{fd-client-event-handler,version_details_struct,string,optional,}
which method do we use to handle fd-sets, *poll* should be here on linux.
@RESTSTRUCT{fd-setsize,version_details_struct,string,optional,}
if not *poll* the fd setsize is valid for the maximum number of filedescriptors
@RESTSTRUCT{full-version-string,version_details_struct,string,optional,}
The full version string
@RESTSTRUCT{icu-version,version_details_struct,string,optional,}
Which version of ICU do we bundle
@RESTSTRUCT{jemalloc,version_details_struct,string,optional,}
*true* if we use jemalloc
@RESTSTRUCT{maintainer-mode,version_details_struct,string,optional,}
*false* if this is a production binary
@RESTSTRUCT{openssl-version,version_details_struct,string,optional,}
which openssl version do we link?
@RESTSTRUCT{platform,version_details_struct,string,optional,}
the host os - *linux*, *windows* or *darwin*
@RESTSTRUCT{reactor-type,version_details_struct,string,optional,}
*epoll* TODO
@RESTSTRUCT{rocksdb-version,version_details_struct,string,optional,}
the rocksdb version this release bundles
@RESTSTRUCT{server-version,version_details_struct,string,optional,}
the ArangoDB release version
@RESTSTRUCT{sizeof int,version_details_struct,string,optional,}
number of bytes for *integers*
@RESTSTRUCT{sizeof void*,version_details_struct,string,optional,}
number of bytes for *void pointers*
@RESTSTRUCT{sse42,version_details_struct,string,optional,}
do we have a SSE 4.2 enabled cpu?
@RESTSTRUCT{unaligned-access,version_details_struct,string,optional,}
does this system support unaligned memory access?
@RESTSTRUCT{v8-version,version_details_struct,string,optional,}
the bundled V8 javascript engine version
@RESTSTRUCT{vpack-version,version_details_struct,string,optional,}
the version of the used velocypack implementation
@RESTSTRUCT{zlib-version,version_details_struct,string,optional,}
the version of the bundled zlib
@RESTSTRUCT{mode,version_details_struct,string,optional,}
the mode we're runnig as - one of [*server*, *console*, *script*]
@RESTSTRUCT{host,version_details_struct,string,optional,}
the host ID
@EXAMPLES
Return the version information
<div class="example-container" id="RestVersion_container">
<a class="anchorjs-link " href="#RestVersion_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestVersion_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"server"</span> : <span class="hljs-string">"arango"</span>,
<span class="hljs-string">"license"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>
}
</pre>
<div id="RestVersion_container_collapse" onclick="$('#RestVersion_long').hide(); $('#RestVersion_short').show(); window.location.hash='RestVersion_container';" class="example_show_button">Hide response body</div></div>
<div id="RestVersion_short" onclick="$('#RestVersion_short').hide(); $('#RestVersion_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Return the version information with details
<div class="example-container" id="RestVersionDetails_container">
<a class="anchorjs-link " href="#RestVersionDetails_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestVersionDetails_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version?details=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"server"</span> : <span class="hljs-string">"arango"</span>,
<span class="hljs-string">"license"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"details"</span> : {
<span class="hljs-string">"architecture"</span> : <span class="hljs-string">"64bit"</span>,
<span class="hljs-string">"arm"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"asan"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"asm-crc32"</span> : <span class="hljs-string">"true"</span>,
<span class="hljs-string">"assertions"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"avx2"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"boost-version"</span> : <span class="hljs-string">"1.69.0"</span>,
<span class="hljs-string">"build-date"</span> : <span class="hljs-string">"2019-10-03 13:56:01"</span>,
<span class="hljs-string">"build-repository"</span> : <span class="hljs-string">"heads/3.5-0-gf3fcba2cc5"</span>,
<span class="hljs-string">"compiler"</span> : <span class="hljs-string">"gcc [8.3.0]"</span>,
<span class="hljs-string">"cplusplus"</span> : <span class="hljs-string">"201402"</span>,
<span class="hljs-string">"curl-version"</span> : <span class="hljs-string">"libcurl/7.65.3-DEV OpenSSL/1.1.1d"</span>,
<span class="hljs-string">"debug"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"endianness"</span> : <span class="hljs-string">"little"</span>,
<span class="hljs-string">"enterprise-version"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"failure-tests"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"fd-client-event-handler"</span> : <span class="hljs-string">"poll"</span>,
<span class="hljs-string">"fd-setsize"</span> : <span class="hljs-string">"1024"</span>,
<span class="hljs-string">"full-version-string"</span> : <span class="hljs-string">"ArangoDB 3.5.1 enterprise [linux] 64bit, using jemalloc, build heads/3.5-0-gf3fcba2cc5, VPack 0.1.33, RocksDB 6.2.0, ICU 58.1, V8 7.1.302.28, OpenSSL 1.1.1d 10 Sep 2019"</span>,
<span class="hljs-string">"icu-version"</span> : <span class="hljs-string">"58.1"</span>,
<span class="hljs-string">"iresearch-version"</span> : <span class="hljs-string">"1.0.0.0"</span>,
<span class="hljs-string">"jemalloc"</span> : <span class="hljs-string">"true"</span>,
<span class="hljs-string">"license"</span> : <span class="hljs-string">"enterprise"</span>,
<span class="hljs-string">"maintainer-mode"</span> : <span class="hljs-string">"false"</span>,
<span class="hljs-string">"ndebug"</span> : <span class="hljs-string">"true"</span>,
<span class="hljs-string">"openssl-version-compile-time"</span> : <span class="hljs-string">"OpenSSL 1.1.1d 10 Sep 2019"</span>,
<span class="hljs-string">"openssl-version-run-time"</span> : <span class="hljs-string">"OpenSSL 1.1.1d 10 Sep 2019"</span>,
<span class="hljs-string">"optimization-flags"</span> : <span class="hljs-string">"-march=nehalem -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mno-sse4a -mno-avx -mno-fma -mno-bmi2 -mno-avx2 -mno-xop -mno-fma4 -mno-avx512f -mno-avx512vl -mno-avx512pf -mno-avx512er -mno-avx512cd -mno-avx512dq -mno-avx512bw -mno-avx512ifma -mno-avx512vbmi"</span>,
<span class="hljs-string">"pic"</span> : <span class="hljs-string">"2"</span>,
<span class="hljs-string">"pie"</span> : <span class="hljs-string">"2"</span>,
<span class="hljs-string">"platform"</span> : <span class="hljs-string">"linux"</span>,
<span class="hljs-string">"reactor-type"</span> : <span class="hljs-string">"epoll"</span>,
<span class="hljs-string">"rocksdb-version"</span> : <span class="hljs-string">"6.2.0"</span>,
<span class="hljs-string">"server-version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"sizeof int"</span> : <span class="hljs-string">"4"</span>,
<span class="hljs-string">"sizeof long"</span> : <span class="hljs-string">"8"</span>,
<span class="hljs-string">"sizeof void*"</span> : <span class="hljs-string">"8"</span>,
<span class="hljs-string">"sse42"</span> : <span class="hljs-string">"true"</span>,
<span class="hljs-string">"unaligned-access"</span> : <span class="hljs-string">"true"</span>,
<span class="hljs-string">"v8-version"</span> : <span class="hljs-string">"7.1.302.28"</span>,
<span class="hljs-string">"vpack-version"</span> : <span class="hljs-string">"0.1.33"</span>,
<span class="hljs-string">"zlib-version"</span> : <span class="hljs-string">"1.2.11"</span>,
<span class="hljs-string">"mode"</span> : <span class="hljs-string">"server"</span>,
<span class="hljs-string">"role"</span> : <span class="hljs-string">"SINGLE"</span>
}
}
</pre>
<div id="RestVersionDetails_container_collapse" onclick="$('#RestVersionDetails_long').hide(); $('#RestVersionDetails_short').show(); window.location.hash='RestVersionDetails_container';" class="example_show_button">Hide response body</div></div>
<div id="RestVersionDetails_short" onclick="$('#RestVersionDetails_short').hide(); $('#RestVersionDetails_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/version?details=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_api_tasks.md -->
@startDocuBlock get_api_tasks
@brief Retrieves one currently active server task
@RESTHEADER{GET /_api/tasks/{id}, Fetch one task with id, getTasks}
@RESTURLPARAM{id,string,required}
The id of the task to fetch.
@RESTDESCRIPTION
fetches one existing task on the server specified by *id*
@RESTRETURNCODE{200}
The requested task
@RESTREPLYBODY{,object,required,api_task_struct}
The function in question
@EXAMPLES
Fetching a single task by its id
<div class="example-container" id="RestTasksListOne_container">
<a class="anchorjs-link " href="#RestTasksListOne_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksListOne_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/tasks</span> &lt;&lt;EOF
{"id":"testTask","command":"console.log('Hello from task!');","offset":10000}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/testTask</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"testTask"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user-defined task"</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1570112303.1886978</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"timed"</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function (params) { console.log('Hello from task!'); } )(params);"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
</pre>
<div id="RestTasksListOne_container_collapse" onclick="$('#RestTasksListOne_long').hide(); $('#RestTasksListOne_short').show(); window.location.hash='RestTasksListOne_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTasksListOne_short" onclick="$('#RestTasksListOne_short').hide(); $('#RestTasksListOne_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/tasks</span> &lt;&lt;EOF
{"id":"testTask","command":"console.log('Hello from task!');","offset":10000}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/testTask</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Trying to fetch a non-existing task
<div class="example-container" id="RestTasksListNonExisting_container">
<a class="anchorjs-link " href="#RestTasksListNonExisting_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksListNonExisting_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/non-existing-task</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"task not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1852</span>
}
</pre>
<div id="RestTasksListNonExisting_container_collapse" onclick="$('#RestTasksListNonExisting_long').hide(); $('#RestTasksListNonExisting_short').show(); window.location.hash='RestTasksListNonExisting_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTasksListNonExisting_short" onclick="$('#RestTasksListNonExisting_short').hide(); $('#RestTasksListNonExisting_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/non-existing-task</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/delete_api_shutdown.md -->
@startDocuBlock delete_api_shutdown
@brief initiates the shutdown sequence
@RESTHEADER{DELETE /_admin/shutdown, Initiate shutdown sequence, RestShutdownHandler}
@RESTDESCRIPTION
This call initiates a clean shutdown sequence. Requires administrive privileges
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned in all cases, `OK` will be returned in the result buffer on success.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_server_mode.md -->
@startDocuBlock get_admin_server_mode
@brief Return the mode of this server (read-only or default)
@RESTHEADER{GET /_admin/server/mode, Return whether or not a server is in read-only mode, handleMode:get}
@RESTDESCRIPTION
Return mode information about a server. The json response will contain
a field `mode` with the value `readonly` or `default`. In a read-only server
all write operations will fail with an error code of `1004` (_ERROR_READ_ONLY_).
Creating or dropping of databases and collections will also fail with error code `11` (_ERROR_FORBIDDEN_).
This is a public API so it does *not* require authentication.
@RESTRETURNCODES
@RESTRETURNCODE{200}
This API will return HTTP 200 if everything is ok
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/post_api_new_tasks.md -->
@startDocuBlock post_api_new_tasks
@brief creates a new task
@RESTHEADER{POST /_api/tasks, creates a task, registerTask}
@RESTBODYPARAM{name,string,required,string}
The name of the task
@RESTBODYPARAM{command,string,required,string}
The JavaScript code to be executed
@RESTBODYPARAM{params,string,required,string}
The parameters to be passed into command
@RESTBODYPARAM{period,integer,optional,int64}
number of seconds between the executions
@RESTBODYPARAM{offset,integer,optional,int64}
Number of seconds initial delay
@RESTDESCRIPTION
creates a new task with a generated id
@RESTRETURNCODES
@RESTRETURNCODE{200}
The task was registered
@RESTREPLYBODY{id,string,required,}
A string identifying the task
@RESTREPLYBODY{created,number,required,float}
The timestamp when this task was created
@RESTREPLYBODY{type,string,required,}
What type of task is this [ `periodic`, `timed`]
- periodic are tasks that repeat periodically
- timed are tasks that execute once at a specific time
@RESTREPLYBODY{period,number,required,}
this task should run each `period` seconds
@RESTREPLYBODY{offset,number,required,float}
time offset in seconds from the created timestamp
@RESTREPLYBODY{command,string,required,}
the javascript function for this task
@RESTREPLYBODY{database,string,required,}
the database this task belongs to
@RESTREPLYBODY{code,number,required,}
The status code, 200 in this case.
@RESTREPLYBODY{error,boolean,required,}
*false* in this case
@RESTRETURNCODE{400}
If the post body is not accurate, a *HTTP 400* is returned.
@EXAMPLES
<div class="example-container" id="RestTasksCreate_container">
<a class="anchorjs-link " href="#RestTasksCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksCreate_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/tasks/</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function(params) { require('@arangodb').print(params); })(params)"</span>,
<span class="hljs-string">"params"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>,
<span class="hljs-string">"bar"</span> : <span class="hljs-string">"foo"</span>
},
<span class="hljs-string">"period"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"71093"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1570112303.1783183</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"periodic"</span>,
<span class="hljs-string">"period"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function (params) { (function(params) { require('@arangodb').print(params); })(params) } )(params);"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/71093</span>
</pre>
<div id="RestTasksCreate_container_collapse" onclick="$('#RestTasksCreate_long').hide(); $('#RestTasksCreate_short').show(); window.location.hash='RestTasksCreate_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTasksCreate_short" onclick="$('#RestTasksCreate_short').hide(); $('#RestTasksCreate_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/tasks/</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function(params) { require('@arangodb').print(params); })(params)"</span>,
<span class="hljs-string">"params"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>,
<span class="hljs-string">"bar"</span> : <span class="hljs-string">"foo"</span>
},
<span class="hljs-string">"period"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/71093</span>
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/post_admin_echo.md -->
@startDocuBlock post_admin_echo
@brief Send back what was sent in, headers, post body etc.
@RESTHEADER{POST /_admin/echo, Return current request, adminEchoJs}
@RESTALLBODYPARAM{body,object,required}
The body can be any type and is simply forwarded.
@RESTDESCRIPTION
The call returns an object with the servers request information
@RESTRETURNCODES
@RESTRETURNCODE{200}
Echo was returned successfully.
@RESTREPLYBODY{authorized,boolean,required,}
whether the session is authorized
@RESTREPLYBODY{user,string,required,}
the currently user that sent this request
@RESTREPLYBODY{database,string,required,}
the database this request was executed on
@RESTREPLYBODY{url,string,required,}
the raw request URL
@RESTREPLYBODY{protocol,string,required,}
the transport, one of ['http', 'https', 'velocystream']
@RESTREPLYBODY{server,object,required,admin_echo_server_struct}
@RESTSTRUCT{address,admin_echo_server_struct,string,required,}
the bind address of the endpoint this request was sent to
@RESTSTRUCT{port,admin_echo_server_struct,integer,required,}
the port this request was sent to
@RESTREPLYBODY{client,object,required,admin_echo_client_struct}
attributes of the client connection
@RESTSTRUCT{address,admin_echo_server_struct,integer,required,}
the ip address of the client
@RESTSTRUCT{port,admin_echo_server_struct,integer,required,}
port of the client side of the tcp connection
@RESTSTRUCT{id,admin_echo_server_struct,string,required,}
a server generated id
@RESTREPLYBODY{internals,object,required,}
contents of the server internals struct
@RESTREPLYBODY{prefix,object,required,}
prefix of the database
@RESTREPLYBODY{headers,object,required,}
the list of the HTTP headers you sent
@RESTREPLYBODY{requestType,string,required,}
In this case *POST*, if you use another HTTP-Verb, you will se that (GET/DELETE, ...)
@RESTREPLYBODY{requestBody,string,required,}
stringified version of the POST body we sent
@RESTREPLYBODY{parameters,object,required,}
Object containing the query parameters
@RESTREPLYBODY{cookies,object,required,}
list of the cookies you sent
@RESTREPLYBODY{suffix,array,required,}
@RESTREPLYBODY{rawSuffix,array,required,}
@RESTREPLYBODY{path,string,required,}
relative path of this request
@RESTREPLYBODY{rawRequestBody,array,required,}
List of digits of the sent characters
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_modules_flush.md -->
@startDocuBlock get_admin_log
@brief returns the server logs
@RESTHEADER{GET /_admin/log, Read global logs from the server, setLogLevel:read}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{upto,string,optional}
Returns all log entries up to log level *upto*. Note that *upto* must be:
- *fatal* or *0*
- *error* or *1*
- *warning* or *2*
- *info* or *3*
- *debug* or *4*
The default value is *info*.
@RESTQUERYPARAM{level,string,optional}
Returns all log entries of log level *level*. Note that the query parameters
*upto* and *level* are mutually exclusive.
@RESTQUERYPARAM{start,number,optional}
Returns all log entries such that their log entry identifier (*lid* value)
is greater or equal to *start*.
@RESTQUERYPARAM{size,number,optional}
Restricts the result to at most *size* log entries.
@RESTQUERYPARAM{offset,number,optional}
Starts to return log entries skipping the first *offset* log entries. *offset*
and *size* can be used for pagination.
@RESTQUERYPARAM{search,string,optional}
Only return the log entries containing the text specified in *search*.
@RESTQUERYPARAM{sort,string,optional}
Sort the log entries either ascending (if *sort* is *asc*) or descending
(if *sort* is *desc*) according to their *lid* values. Note that the *lid*
imposes a chronological order. The default value is *asc*.
@RESTDESCRIPTION
Returns fatal, error, warning or info log messages from the server's global log.
The result is a JSON object with the following attributes:
@RESTRETURNCODES
@RESTRETURNCODE{200}
@RESTREPLYBODY{lid,array,required,string}
a list of log entry identifiers. Each log message is uniquely
identified by its @LIT{lid} and the identifiers are in ascending
order.
@RESTREPLYBODY{level,string,required,string}
A list of the log levels for all log entries.
@RESTREPLYBODY{timestamp,array,required,string}
a list of the timestamps as seconds since 1970-01-01 for all log
entries.
@RESTREPLYBODY{text,string,required,string}
a list of the texts of all log entries
@RESTREPLYBODY{topic,string,required,string}
a list of the topics of all log entries
@RESTREPLYBODY{totalAmount,integer,required,int64}
the total amount of log entries before pagination.
@RESTRETURNCODE{400}
is returned if invalid values are specified for *upto* or *level*.
@RESTRETURNCODE{500}
is returned if the server cannot generate the result due to an out-of-memory
error.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_modules_flush.md -->
@startDocuBlock get_admin_loglevel
@brief returns the current log level settings
@RESTHEADER{GET /_admin/log/level, Return the current server log level}
@RESTDESCRIPTION
Returns the server's current log level settings.
The result is a JSON object with the log topics being the object keys, and
the log levels being the object values.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request is valid
@RESTRETURNCODE{500}
is returned if the server cannot generate the result due to an out-of-memory
error.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_modules_flush.md -->
@startDocuBlock put_admin_loglevel
@brief modifies the current log level settings
@RESTHEADER{PUT /_admin/log/level, Modify and return the current server log level}
@RESTDESCRIPTION
Modifies and returns the server's current log level settings.
The request body must be a JSON object with the log topics being the object keys
and the log levels being the object values.
The result is a JSON object with the adjusted log topics being the object keys, and
the adjusted log levels being the object values.
It can set the log level of all facilities by only specifying the log level as string without json.
Possible log levels are:
- FATAL - There will be no way out of this. ArangoDB will go down after this message.
- ERROR - This is an error. you should investigate and fix it. It may harm your production.
- WARNING - This may be serious application-wise, but we don't know.
- INFO - Something has happened, take notice, but no drama attached.
- DEBUG - output debug messages
- TRACE - trace - prepare your log to be flooded - don't use in production.
@RESTBODYPARAM{agency,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{agencycomm,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{authentication,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{authorization,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{cache,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{cluster,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{collector,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{communication,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{compactor,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{config,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{datafiles,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{development,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{engines,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{general,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{graphs,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{heartbeat,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{memory,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{mmap,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{performance,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{pregel,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{queries,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{replication,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{requests,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{rocksdb,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{ssl,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{startup,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{supervision,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{syscall,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{threads,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{trx,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{v8,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{views,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{ldap,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-authentication,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-authorization,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-database,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-collection,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-view,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-document,string,optional,string}
One of the possible log levels.
@RESTBODYPARAM{audit-service,string,optional,string}
One of the possible log levels.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request is valid
@RESTRETURNCODE{400}
is returned when the request body contains invalid JSON.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if the server cannot generate the result due to an out-of-memory
error.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_routing_reloads.md -->
@startDocuBlock get_admin_routing_reloads
@brief Reload the routing table.
@RESTHEADER{POST /_admin/routing/reload, Reloads the routing information, RestAdminRoutingHandler}
@RESTDESCRIPTION
Reloads the routing information from the collection *routing*.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Routing information was reloaded successfully.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_api_tasks_all.md -->
@startDocuBlock get_api_tasks_all
@brief Retrieves all currently active server tasks
@RESTHEADER{GET /_api/tasks/, Fetch all tasks or one task, getTasks}
@RESTDESCRIPTION
fetches all existing tasks on the server
@RESTRETURNCODE{200}
The list of tasks
@RESTREPLYBODY{,array,required,api_task_struct}
a list of all tasks
@EXAMPLES
Fetching all tasks
<div class="example-container" id="RestTasksListAll_container">
<a class="anchorjs-link " href="#RestTasksListAll_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksListAll_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69070"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"user-defined task"</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1570112296.7870114</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"periodic"</span>,
<span class="hljs-string">"period"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0.000001</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function (params) { (function () {\n require('@arangodb/foxx/queues/manager').manage();\n })(params) } )(params);"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
]
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_statistics_description.md -->
@startDocuBlock get_admin_statistics_description
@brief fetch descriptive info of statistics
@RESTHEADER{GET /_admin/statistics-description, Statistics description, getStatisticsDescription}
@RESTDESCRIPTION
Returns a description of the statistics returned by */_admin/statistics*.
The returned objects contains an array of statistics groups in the attribute
*groups* and an array of statistics figures in the attribute *figures*.
A statistics group is described by
- *group*: The identifier of the group.
- *name*: The name of the group.
- *description*: A description of the group.
A statistics figure is described by
- *group*: The identifier of the group to which this figure belongs.
- *identifier*: The identifier of the figure. It is unique within the group.
- *name*: The name of the figure.
- *description*: A description of the figure.
- *type*: Either *current*, *accumulated*, or *distribution*.
- *cuts*: The distribution vector.
- *units*: Units in which the figure is measured.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Description was returned successfully.
@RESTREPLYBODY{groups,array,required,admin_statistics_group_struct}
A statistics group
@RESTSTRUCT{group,admin_statistics_group_struct,string,required,}
The identifier of the group.
@RESTSTRUCT{name,admin_statistics_group_struct,string,required,}
The name of the group.
@RESTSTRUCT{description,admin_statistics_group_struct,string,required,}
A description of the group.
@RESTREPLYBODY{figures,array,required,admin_statistics_figures_struct}
A statistics figure
@RESTSTRUCT{group,admin_statistics_figures_struct,string,required,}
The identifier of the group to which this figure belongs.
@RESTSTRUCT{identifier,admin_statistics_figures_struct,string,required,}
The identifier of the figure. It is unique within the group.
@RESTSTRUCT{name,admin_statistics_figures_struct,string,required,}
The name of the figure.
@RESTSTRUCT{description,admin_statistics_figures_struct,string,required,}
A description of the figure.
@RESTSTRUCT{type,admin_statistics_figures_struct,string,required,}
Either *current*, *accumulated*, or *distribution*.
@RESTSTRUCT{cuts,admin_statistics_figures_struct,string,required,}
The distribution vector.
@RESTSTRUCT{units,admin_statistics_figures_struct,string,required,}
Units in which the figure is measured.
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{error,boolean,required,}
the error, *false* in this case
@EXAMPLES
<div class="example-container" id="RestAdminStatisticsDescription1_container">
<a class="anchorjs-link " href="#RestAdminStatisticsDescription1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAdminStatisticsDescription1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/statistics-description</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"groups"</span> : [
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Process Statistics"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Statistics about the ArangoDB process"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Client Connection Statistics"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Statistics about the connections."</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP Request Statistics"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Statistics about the HTTP requests."</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"server"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Server Statistics"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Statistics about the ArangoDB server"</span>
}
],
<span class="hljs-string">"figures"</span> : [
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"userTime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"User Time"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Amount of time that this process has been scheduled in user mode, measured in seconds."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"systemTime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"System Time"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Amount of time that this process has been scheduled in kernel mode, measured in seconds."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"numberOfThreads"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Number of Threads"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of threads in the arangod process."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"residentSize"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Resident Set Size"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"The total size of the number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out. The resident set size is reported in bytes."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"bytes"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"residentSizePercent"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Resident Set Size"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"The percentage of physical memory used by the process as resident set size."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"percent"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"virtualSize"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Virtual Memory Size"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"On Windows, this figure contains the total amount of memory that the memory manager has committed for the arangod process. On other systems, this figure contains The size of the virtual memory the process is using."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"bytes"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"minorPageFaults"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Minor Page Faults"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"The number of minor faults the process has made which have not required loading a memory page from disk. This figure is not reported on Windows."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"system"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"majorPageFaults"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Major Page Faults"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"On Windows, this figure contains the total number of page faults. On other system, this figure contains the number of major faults the process has made which have required loading a memory page from disk."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"httpConnections"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Client Connections"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"The number of connections that are currently open."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"totalTime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Total Time"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Total time needed to answer a request."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"distribution"</span>,
<span class="hljs-string">"cuts"</span> : [
<span class="hljs-number">0.01</span>,
<span class="hljs-number">0.05</span>,
<span class="hljs-number">0.1</span>,
<span class="hljs-number">0.2</span>,
<span class="hljs-number">0.5</span>,
<span class="hljs-number">1</span>
],
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestTime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Request Time"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Request time needed to answer a request."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"distribution"</span>,
<span class="hljs-string">"cuts"</span> : [
<span class="hljs-number">0.01</span>,
<span class="hljs-number">0.05</span>,
<span class="hljs-number">0.1</span>,
<span class="hljs-number">0.2</span>,
<span class="hljs-number">0.5</span>,
<span class="hljs-number">1</span>
],
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"queueTime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Queue Time"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Queue time needed to answer a request."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"distribution"</span>,
<span class="hljs-string">"cuts"</span> : [
<span class="hljs-number">0.01</span>,
<span class="hljs-number">0.05</span>,
<span class="hljs-number">0.1</span>,
<span class="hljs-number">0.2</span>,
<span class="hljs-number">0.5</span>,
<span class="hljs-number">1</span>
],
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"bytesSent"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bytes Sent"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Bytes sents for a request."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"distribution"</span>,
<span class="hljs-string">"cuts"</span> : [
<span class="hljs-number">250</span>,
<span class="hljs-number">1000</span>,
<span class="hljs-number">2000</span>,
<span class="hljs-number">5000</span>,
<span class="hljs-number">10000</span>
],
<span class="hljs-string">"units"</span> : <span class="hljs-string">"bytes"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"bytesReceived"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bytes Received"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Bytes received for a request."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"distribution"</span>,
<span class="hljs-string">"cuts"</span> : [
<span class="hljs-number">250</span>,
<span class="hljs-number">1000</span>,
<span class="hljs-number">2000</span>,
<span class="hljs-number">5000</span>,
<span class="hljs-number">10000</span>
],
<span class="hljs-string">"units"</span> : <span class="hljs-string">"bytes"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"client"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"connectionTime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Connection Time"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Total connection time of a client."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"distribution"</span>,
<span class="hljs-string">"cuts"</span> : [
<span class="hljs-number">0.1</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">60</span>
],
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsTotal"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Total requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Total number of HTTP requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsAsync"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Async requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of asynchronously executed HTTP requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsGet"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP GET requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP GET requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsHead"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP HEAD requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP HEAD requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsPost"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP POST requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP POST requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsPut"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP PUT requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP PUT requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsPatch"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP PATCH requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP PATCH requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsDelete"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP DELETE requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP DELETE requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsOptions"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"HTTP OPTIONS requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of HTTP OPTIONS requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"http"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"requestsOther"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"other HTTP requests"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of other HTTP requests."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"accumulated"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"number"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"server"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"uptime"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Server Uptime"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Number of seconds elapsed since server start."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"seconds"</span>
},
{
<span class="hljs-string">"group"</span> : <span class="hljs-string">"server"</span>,
<span class="hljs-string">"identifier"</span> : <span class="hljs-string">"physicalMemory"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Physical Memory"</span>,
<span class="hljs-string">"description"</span> : <span class="hljs-string">"Physical memory in bytes."</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"current"</span>,
<span class="hljs-string">"units"</span> : <span class="hljs-string">"bytes"</span>
}
],
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestAdminStatisticsDescription1_container_collapse" onclick="$('#RestAdminStatisticsDescription1_long').hide(); $('#RestAdminStatisticsDescription1_short').show(); window.location.hash='RestAdminStatisticsDescription1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAdminStatisticsDescription1_short" onclick="$('#RestAdminStatisticsDescription1_short').hide(); $('#RestAdminStatisticsDescription1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/statistics-description</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/put_admin_server_mode.md -->
@startDocuBlock put_admin_server_mode
@brief Update the mode of this server (read-only or default)
@RESTHEADER{PUT /_admin/server/mode, Update whether or not a server is in read-only mode, handleMode:set}
@RESTBODYPARAM{mode,string,required,string}
The mode of the server `readonly` or `default`.
@RESTDESCRIPTION
Update mode information about a server. The json response will contain
a field `mode` with the value `readonly` or `default`. In a read-only server
all write operations will fail with an error code of `1004` (_ERROR_READ_ONLY_).
Creating or dropping of databases and collections will also fail with error code `11` (_ERROR_FORBIDDEN_).
This API so it *does require* authentication and administrative server rights.
@RESTRETURNCODES
@RESTRETURNCODE{200}
This API will return HTTP 200 if everything is ok
@RESTRETURNCODE{401}
if the request was not authenticated as a user with sufficient rights
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_engine.md -->
@startDocuBlock get_engine
@brief returns the engine the type the server is running with
@RESTHEADER{GET /_api/engine, Return server database engine type, RestEngineHandler}
@RESTDESCRIPTION
Returns the storage engine the server is configured to use.
The response is a JSON object with the following attributes:
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned in all cases.
@RESTREPLYBODY{name,string,required,string}
will be *mmfiles* or *rocksdb*
@EXAMPLES
Return the active storage engine with the MMFiles storage engine in use:
<div class="example-container" id="RestEngine_mmfiles_container">
<a class="anchorjs-link " href="#RestEngine_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestEngine_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/engine</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"mmfiles"</span>,
<span class="hljs-string">"supports"</span> : {
<span class="hljs-string">"dfdb"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexes"</span> : [
<span class="hljs-string">"primary"</span>,
<span class="hljs-string">"edge"</span>,
<span class="hljs-string">"hash"</span>,
<span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"ttl"</span>,
<span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"geo"</span>,
<span class="hljs-string">"fulltext"</span>
],
<span class="hljs-string">"aliases"</span> : {
<span class="hljs-string">"indexes"</span> : {
}
}
}
}
</pre>
<div id="RestEngine_mmfiles_container_collapse" onclick="$('#RestEngine_mmfiles_long').hide(); $('#RestEngine_mmfiles_short').show(); window.location.hash='RestEngine_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestEngine_mmfiles_short" onclick="$('#RestEngine_mmfiles_short').hide(); $('#RestEngine_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/engine</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Return the active storage engine with the RocksDB storage engine in use:
<div class="example-container" id="RestEngine_rocksdb_container">
<a class="anchorjs-link " href="#RestEngine_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestEngine_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/engine</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"rocksdb"</span>,
<span class="hljs-string">"supports"</span> : {
<span class="hljs-string">"dfdb"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexes"</span> : [
<span class="hljs-string">"primary"</span>,
<span class="hljs-string">"edge"</span>,
<span class="hljs-string">"hash"</span>,
<span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"ttl"</span>,
<span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"geo"</span>,
<span class="hljs-string">"fulltext"</span>
],
<span class="hljs-string">"aliases"</span> : {
<span class="hljs-string">"indexes"</span> : {
<span class="hljs-string">"skiplist"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"hash"</span> : <span class="hljs-string">"persistent"</span>
}
}
}
}
</pre>
<div id="RestEngine_rocksdb_container_collapse" onclick="$('#RestEngine_rocksdb_long').hide(); $('#RestEngine_rocksdb_short').show(); window.location.hash='RestEngine_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestEngine_rocksdb_short" onclick="$('#RestEngine_rocksdb_short').hide(); $('#RestEngine_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/engine</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/put_api_new_tasks.md -->
@startDocuBlock put_api_new_tasks
@brief registers a new task with a pre-defined id; not compatible with load balancers
@RESTHEADER{PUT /_api/tasks/{id}, creates a task with id, registerTask:byId}
@RESTURLPARAM{id,string,required}
The id of the task to create
@RESTBODYPARAM{name,string,required,string}
The name of the task
@RESTBODYPARAM{command,string,required,string}
The JavaScript code to be executed
@RESTBODYPARAM{params,string,required,string}
The parameters to be passed into command
@RESTBODYPARAM{period,integer,optional,int64}
number of seconds between the executions
@RESTBODYPARAM{offset,integer,optional,int64}
Number of seconds initial delay
@RESTDESCRIPTION
registers a new task with the specified id
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the task *id* already exists or the rest body is not accurate, *HTTP 400* is returned.
@EXAMPLES
<div class="example-container" id="RestTasksPutWithId_container">
<a class="anchorjs-link " href="#RestTasksPutWithId_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksPutWithId_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/tasks/sampleTask</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function(params) { require('@arangodb').print(params); })(params)"</span>,
<span class="hljs-string">"params"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>,
<span class="hljs-string">"bar"</span> : <span class="hljs-string">"foo"</span>
},
<span class="hljs-string">"period"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"sampleTask"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"created"</span> : <span class="hljs-number">1570112303.1913922</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"periodic"</span>,
<span class="hljs-string">"period"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function (params) { (function(params) { require('@arangodb').print(params); })(params) } )(params);"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
</pre>
<div id="RestTasksPutWithId_container_collapse" onclick="$('#RestTasksPutWithId_long').hide(); $('#RestTasksPutWithId_short').show(); window.location.hash='RestTasksPutWithId_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTasksPutWithId_short" onclick="$('#RestTasksPutWithId_short').hide(); $('#RestTasksPutWithId_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/tasks/sampleTask</span> &lt;&lt;EOF
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SampleTask"</span>,
<span class="hljs-string">"command"</span> : <span class="hljs-string">"(function(params) { require('@arangodb').print(params); })(params)"</span>,
<span class="hljs-string">"params"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>,
<span class="hljs-string">"bar"</span> : <span class="hljs-string">"foo"</span>
},
<span class="hljs-string">"period"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_api_cluster_endpoints.md -->
@startDocuBlock get_api_cluster_endpoints
@brief This API call returns information about all coordinator endpoints (cluster only).
@RESTHEADER{GET /_api/cluster/endpoints, Get information about all coordinator endpoints, handleCommandEndpoints:listClusterEndpoints}
@RESTDESCRIPTION
Returns an object with an attribute `endpoints`, which contains an
array of objects, which each have the attribute `endpoint`, whose value
is a string with the endpoint description. There is an entry for each
coordinator in the cluster. This method only works on coordinators in
cluster mode. In case of an error the `error` attribute is set to
`true`.
@RESTRETURNCODES
@RESTRETURNCODE{200} is returned when everything went well.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*true* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code - 200
@RESTREPLYBODY{endpoints,array,required,cluster_endpoints_struct}
A list of active cluster endpoints.
@RESTSTRUCT{endpoint,cluster_endpoints_struct,string,required,}
The bind of the coordinator, like `tcp://[::1]:8530`
@RESTRETURNCODE{403} server is not a coordinator or method was not GET.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_server_availability.md -->
@startDocuBlock get_admin_server_availability
@brief Return whether or not a server is available
@RESTHEADER{GET /_admin/server/availability, Return whether or not a server is available, handleAvailability}
@RESTDESCRIPTION
Return availability information about a server.
This is a public API so it does *not* require authentication. It is meant to be
used only in the context of server monitoring only.
@RESTRETURNCODES
@RESTRETURNCODE{200}
This API will return HTTP 200 in case the server is up and running and usable for
arbitrary operations, is not set to read-only mode and is currently not a follower
in case of an active failover setup.
@RESTRETURNCODE{503}
HTTP 503 will be returned in case the server is during startup or during shutdown,
is set to read-only mode or is currently a follower in an active failover setup.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_server_id.md -->
@startDocuBlock get_admin_server_id
@brief Get to know the internal id of the server
@RESTHEADER{GET /_admin/server/id, Return id of a server in a cluster, handleId}
@RESTDESCRIPTION
Returns the id of a server in a cluster. The request will fail if the
server is not running in cluster mode.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned when the server is running in cluster mode.
@RESTRETURNCODE{500}
Is returned when the server is not running in cluster mode.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/JSF_get_admin_status.md -->
@startDocuBlock JSF_get_admin_status
@brief returns status information of the server.
@RESTHEADER{GET /_admin/status, Return status information, RestStatusHandler}
@RESTDESCRIPTION
Returns status information about the server.
This is intended for manual use by the support and should
never be used for monitoring or automatic tests. The results
are subject to change without notice.
The call returns an object with the following attributes:
- *server*: always *arango*.
- *license*: either *community* or *enterprise*.
- *version*: the server version as string.
- *mode* : either *server* or *console*.
- *host*: the hostname, see *ServerState*.
- *serverInfo.role*: either *SINGLE*, *COORDINATOR*, *PRIMARY*, *AGENT*.
- *serverInfo.writeOpsEnabled*: boolean, true if writes are enabled.
- *serverInfo.maintenance*: boolean, true if maintenace mode is enabled.
- *agency.endpoints*: a list of possible agency endpoints.
An agent, coordinator or primary will also have
- *serverInfo.persistedId*: the persisted ide, e. g. *"CRDN-e427b441-5087-4a9a-9983-2fb1682f3e2a"*.
A coordinator or primary will also have
- *serverInfo.state*: *SERVING*
- *serverInfo.address*: the address of the server, e. g. *tcp://[::1]:8530*.
- *serverInfo.serverId*: the server ide, e. g. *"CRDN-e427b441-5087-4a9a-9983-2fb1682f3e2a"*.
A coordinator will also have
- *coordinator.foxxmaster*: the server id of the foxx master.
- *coordinator.isFoxxmaster*: boolean, true if the server is the foxx master.
An agent will also have
- *agent.id*: server id of this agent.
- *agent.leaderId*: server id of the leader.
- *agent.leading*: boolean, true if leading.
- *agent.endpoint*: the endpoint of this agent.
- *agent.term*: current term number.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Status information was returned successfully.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_time.md -->
@startDocuBlock get_admin_time
@brief Get the current time of the system
@RESTHEADER{GET /_admin/time, Return system time, RestTimeHandler}
@RESTDESCRIPTION
The call returns an object with the attribute *time*. This contains the
current system time as a Unix timestamp with microsecond precision.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Time was returned successfully.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{time,number,required,float}
The current system time as a Unix timestamp with microsecond precision of the server
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_database_version.md -->
@startDocuBlock get_admin_database_version
@brief returns the version of the database.
@RESTHEADER{GET /_admin/database/target-version, Return the required version of the database, RestAdminDatabaseHandler}
@RESTDESCRIPTION
Returns the database version that this server requires.
The version is returned in the *version* attribute of the result.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned in all cases.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_statistics.md -->
@startDocuBlock get_admin_statistics
@brief return the statistics information
@RESTHEADER{GET /_admin/statistics, Read the statistics, getStatistics}
@RESTDESCRIPTION
Returns the statistics information. The returned object contains the
statistics figures grouped together according to the description returned by
*_admin/statistics-description*. For instance, to access a figure *userTime*
from the group *system*, you first select the sub-object describing the
group stored in *system* and in that sub-object the value for *userTime* is
stored in the attribute of the same name.
In case of a distribution, the returned object contains the total count in
*count* and the distribution list in *counts*. The sum (or total) of the
individual values is returned in *sum*.
The transaction statistics show the local started, committed and aborted
transactions as well as intermediate commits done for the server queried. The
intermediate commit count will only take non zero values for the RocksDB
storage engine. Coordinators do almost no local transactions themselves in
their local databases, therefor cluster transactions (transactions started on a
coordinator that require DBServers to finish before the transactions is
committed cluster wide) are just added to their local statistics. This means
that the statistics you would see for a single server is roughly what you can
expect in a cluster setup using a single coordinator querying this coordinator.
Just with the difference that cluster transactions have no notion of
intermediate commits and will not increase the value.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Statistics were returned successfully.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code - 200 in this case
@RESTREPLYBODY{time,integer,required,int64}
the current server timestamp
@RESTREPLYBODY{errorMessage,string,required,string}
a descriptive error message
@RESTREPLYBODY{enabled,boolean,required,}
*true* if the server has the statistics module enabled. If not, don't expect any values.
@RESTREPLYBODY{system,object,required,system_statistics_struct}
metrics gathered from the system about this process; may depend on the host OS
@RESTSTRUCT{minorPageFaults,system_statistics_struct,integer,required,}
pagefaults
@RESTSTRUCT{majorPageFaults,system_statistics_struct,integer,required,}
pagefaults
@RESTSTRUCT{userTime,system_statistics_struct,number,required,float}
the user CPU time used by the server process
@RESTSTRUCT{systemTime,system_statistics_struct,number,required,float}
the system CPU time used by the server process
@RESTSTRUCT{numberOfThreads,system_statistics_struct,integer,required,}
the number of threads in the server
@RESTSTRUCT{residentSize,system_statistics_struct,integer,required,}
RSS of process
@RESTSTRUCT{residentSizePercent,system_statistics_struct,number,required,float}
RSS of process in %
@RESTSTRUCT{virtualSize,system_statistics_struct,integer,required,}
VSS of the process
@RESTREPLYBODY{client,object,required,client_statistics_struct}
information about the connected clients and their resource usage
@RESTSTRUCT{sum,setof_statistics_struct,number,required,}
summarized value of all counts
@RESTSTRUCT{count,setof_statistics_struct,integer,required,}
number of values summarized
@RESTSTRUCT{counts,setof_statistics_struct,array,required,integer}
array containing the values
@RESTSTRUCT{connectionTime,client_statistics_struct,object,required,setof_statistics_struct}
total connection times
@RESTSTRUCT{totalTime,client_statistics_struct,object,required,setof_statistics_struct}
the system time
@RESTSTRUCT{requestTime,client_statistics_struct,object,required,setof_statistics_struct}
the request times
@RESTSTRUCT{queueTime,client_statistics_struct,object,required,setof_statistics_struct}
the time requests were queued waiting for processing
@RESTSTRUCT{ioTime,client_statistics_struct,object,required,setof_statistics_struct}
IO Time
@RESTSTRUCT{bytesSent,client_statistics_struct,object,required,setof_statistics_struct}
number of bytes sent to the clients
@RESTSTRUCT{bytesReceived,client_statistics_struct,object,required,setof_statistics_struct}
number of bytes received from the clients
@RESTSTRUCT{httpConnections,client_statistics_struct,integer,required,}
the number of open http connections
@RESTREPLYBODY{http,object,required,http_statistics_struct}
the numbers of requests by Verb
@RESTSTRUCT{requestsTotal,http_statistics_struct,integer,required,}
total number of http requests
@RESTSTRUCT{requestsAsync,http_statistics_struct,integer,required,}
total number of asynchronous http requests
@RESTSTRUCT{requestsGet,http_statistics_struct,integer,required,}
No of requests using the GET-verb
@RESTSTRUCT{requestsHead,http_statistics_struct,integer,required,}
No of requests using the HEAD-verb
@RESTSTRUCT{requestsPost,http_statistics_struct,integer,required,}
No of requests using the POST-verb
@RESTSTRUCT{requestsPut,http_statistics_struct,integer,required,}
No of requests using the PUT-verb
@RESTSTRUCT{requestsPatch,http_statistics_struct,integer,required,}
No of requests using the PATCH-verb
@RESTSTRUCT{requestsDelete,http_statistics_struct,integer,required,}
No of requests using the DELETE-verb
@RESTSTRUCT{requestsOptions,http_statistics_struct,integer,required,}
No of requests using the OPTIONS-verb
@RESTSTRUCT{requestsOther,http_statistics_struct,integer,required,}
No of requests using the none of the above identified verbs
@RESTREPLYBODY{server,object,required,server_statistics_struct}
statistics of the server
@RESTSTRUCT{uptime,server_statistics_struct,integer,required,}
time the server is up and running
@RESTSTRUCT{physicalMemory,server_statistics_struct,integer,required,}
available physical memory on the server
@RESTSTRUCT{transactions,server_statistics_struct,object,required,transactions_struct}
Statistics about transactions
@RESTSTRUCT{started,transactions_struct,integer,required,}
the number of started transactions
@RESTSTRUCT{committed,transactions_struct,integer,required,}
the number of committed transactions
@RESTSTRUCT{aborted,transactions_struct,integer,required,}
the number of aborted transactions
@RESTSTRUCT{intermediateCommits,transactions_struct,integer,required,}
the number of intermediate commits done
@RESTSTRUCT{v8Context,server_statistics_struct,object,required,v8_context_struct}
Statistics about the V8 javascript contexts
@RESTSTRUCT{available,v8_context_struct,integer,required,}
the number of currently spawnen V8 contexts
@RESTSTRUCT{busy,v8_context_struct,integer,required,}
the number of currently active V8 contexts
@RESTSTRUCT{dirty,v8_context_struct,integer,required,}
the number of contexts that were previously used, and should now be garbage collected before being re-used
@RESTSTRUCT{free,v8_context_struct,integer,required,}
the number of V8 contexts that are free to use
@RESTSTRUCT{max,v8_context_struct,integer,required,}
the total number of V8 contexts we may spawn as configured by --javascript.v8-contexts
@RESTSTRUCT{memory,v8_context_struct,array,required,v8_isolate_memory}
a list of V8 memory / garbage collection watermarks; Refreshed on every garbage collection run;
Preserves min/max memory used at that time for 10 seconds
@RESTSTRUCT{contextId,v8_isolate_memory,integer,required,}
ID of the context this set of memory statistics is from
@RESTSTRUCT{tMax,v8_isolate_memory,number,required,}
the timestamp where the 10 seconds interval started
@RESTSTRUCT{countOfTimes,v8_isolate_memory,integer,required,}
how many times was the garbage collection run in these 10 seconds
@RESTSTRUCT{heapMax,v8_isolate_memory,integer,required,}
High watermark of all garbage collection runs in 10 seconds
@RESTSTRUCT{heapMin,v8_isolate_memory,integer,required,}
Low watermark of all garbage collection runs in these 10 seconds
@RESTSTRUCT{threads,server_statistics_struct,object,required,server_threads_struct}
Statistics about the server worker threads (excluding V8 specific or jemalloc specific threads and system threads)
@RESTSTRUCT{scheduler-threads,server_threads_struct,integer,required,}
The number of spawned worker threads
@RESTSTRUCT{in-progress,server_threads_struct,integer,required,}
The number of currently busy worker threads
@RESTSTRUCT{queued,server_threads_struct,integer,required,}
The number of jobs queued up waiting for worker threads becomming available
@EXAMPLES
<div class="example-container" id="RestAdminStatistics1_container">
<a class="anchorjs-link " href="#RestAdminStatistics1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAdminStatistics1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/statistics</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"time"</span> : <span class="hljs-number">1570112261.6835103</span>,
<span class="hljs-string">"enabled"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"system"</span> : {
<span class="hljs-string">"minorPageFaults"</span> : <span class="hljs-number">96117</span>,
<span class="hljs-string">"majorPageFaults"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"userTime"</span> : <span class="hljs-number">5.17</span>,
<span class="hljs-string">"systemTime"</span> : <span class="hljs-number">1.83</span>,
<span class="hljs-string">"numberOfThreads"</span> : <span class="hljs-number">58</span>,
<span class="hljs-string">"residentSize"</span> : <span class="hljs-number">310177792</span>,
<span class="hljs-string">"residentSizePercent"</span> : <span class="hljs-number">0.0045942798373683055</span>,
<span class="hljs-string">"virtualSize"</span> : <span class="hljs-number">1411366912</span>
},
<span class="hljs-string">"client"</span> : {
<span class="hljs-string">"httpConnections"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"connectionTime"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
]
},
<span class="hljs-string">"totalTime"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">5.284323692321777</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">34736</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">0</span>
]
},
<span class="hljs-string">"requestTime"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">3.7703793048858643</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">34736</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">0</span>
]
},
<span class="hljs-string">"queueTime"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">0.046926259994506836</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">34742</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
]
},
<span class="hljs-string">"ioTime"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">1.4670181274414062</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">34742</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
]
},
<span class="hljs-string">"bytesSent"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">10341111</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">261</span>,
<span class="hljs-number">34084</span>,
<span class="hljs-number">359</span>,
<span class="hljs-number">37</span>,
<span class="hljs-number">1</span>,
<span class="hljs-number">0</span>
]
},
<span class="hljs-string">"bytesReceived"</span> : {
<span class="hljs-string">"sum"</span> : <span class="hljs-number">8171953</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"counts"</span> : [
<span class="hljs-number">33759</span>,
<span class="hljs-number">983</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>,
<span class="hljs-number">0</span>
]
}
},
<span class="hljs-string">"http"</span> : {
<span class="hljs-string">"requestsTotal"</span> : <span class="hljs-number">34742</span>,
<span class="hljs-string">"requestsAsync"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"requestsGet"</span> : <span class="hljs-number">875</span>,
<span class="hljs-string">"requestsHead"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"requestsPost"</span> : <span class="hljs-number">33727</span>,
<span class="hljs-string">"requestsPut"</span> : <span class="hljs-number">33</span>,
<span class="hljs-string">"requestsPatch"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"requestsDelete"</span> : <span class="hljs-number">105</span>,
<span class="hljs-string">"requestsOptions"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"requestsOther"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"uptime"</span> : <span class="hljs-number">11.630286455154419</span>,
<span class="hljs-string">"physicalMemory"</span> : <span class="hljs-number">67513909248</span>,
<span class="hljs-string">"transactions"</span> : {
<span class="hljs-string">"started"</span> : <span class="hljs-number">35074</span>,
<span class="hljs-string">"aborted"</span> : <span class="hljs-number">290</span>,
<span class="hljs-string">"committed"</span> : <span class="hljs-number">34783</span>,
<span class="hljs-string">"intermediateCommits"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"v8Context"</span> : {
<span class="hljs-string">"available"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"busy"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"dirty"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"free"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"max"</span> : <span class="hljs-number">16</span>,
<span class="hljs-string">"memory"</span> : [
{
<span class="hljs-string">"contextId"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"tMax"</span> : <span class="hljs-number">1570112250.8134346</span>,
<span class="hljs-string">"countOfTimes"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"heapMax"</span> : <span class="hljs-number">15018472</span>,
<span class="hljs-string">"heapMin"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"threads"</span> : {
<span class="hljs-string">"scheduler-threads"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"blocked"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"queued"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"in-progress"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"direct-exec"</span> : <span class="hljs-number">34655</span>
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestAdminStatistics1_container_collapse" onclick="$('#RestAdminStatistics1_long').hide(); $('#RestAdminStatistics1_short').show(); window.location.hash='RestAdminStatistics1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAdminStatistics1_short" onclick="$('#RestAdminStatistics1_short').hide(); $('#RestAdminStatistics1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/statistics</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/delete_api_tasks.md -->
@startDocuBlock delete_api_tasks
@brief deletes one currently active server task
@RESTHEADER{DELETE /_api/tasks/{id}, deletes the task with id, deleteTask}
@RESTURLPARAM{id,string,required}
The id of the task to delete.
@RESTDESCRIPTION
Deletes the task identified by *id* on the server.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the task was deleted, *HTTP 200* is returned.
@RESTREPLYBODY{code,number,required,}
The status code, 200 in this case.
@RESTREPLYBODY{error,boolean,required,}
*false* in this case
@RESTRETURNCODE{404}
If the task *id* is unknown, then an *HTTP 404* is returned.
@RESTREPLYBODY{code,number,required,}
The status code, 404 in this case.
@RESTREPLYBODY{error,boolean,required,}
*true* in this case
@RESTREPLYBODY{errorMessage,string,required,}
A plain text message stating what went wrong.
@EXAMPLES
trying to delete non existing task
<div class="example-container" id="RestTasksDeleteFail_container">
<a class="anchorjs-link " href="#RestTasksDeleteFail_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksDeleteFail_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/NoTaskWithThatName</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"task not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1852</span>
}
</pre>
<div id="RestTasksDeleteFail_container_collapse" onclick="$('#RestTasksDeleteFail_long').hide(); $('#RestTasksDeleteFail_short').show(); window.location.hash='RestTasksDeleteFail_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTasksDeleteFail_short" onclick="$('#RestTasksDeleteFail_short').hide(); $('#RestTasksDeleteFail_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/NoTaskWithThatName</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Remove existing Task
<div class="example-container" id="RestTasksDelete_container">
<a class="anchorjs-link " href="#RestTasksDelete_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTasksDelete_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/SampleTask</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-string">"(non-representable type)"</span>
}
</pre>
<div id="RestTasksDelete_container_collapse" onclick="$('#RestTasksDelete_long').hide(); $('#RestTasksDelete_short').show(); window.location.hash='RestTasksDelete_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTasksDelete_short" onclick="$('#RestTasksDelete_short').hide(); $('#RestTasksDelete_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/tasks/SampleTask</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/post_admin_execute.md -->
@startDocuBlock post_admin_execute
@brief Execute a script on the server.
@RESTHEADER{POST /_admin/execute, Execute program, RestAdminExecuteHandler}
@RESTALLBODYPARAM{body,string,required}
The body to be executed.
@RESTDESCRIPTION
Executes the javascript code in the body on the server as the body
of a function with no arguments. If you have a *return* statement
then the return value you produce will be returned as content type
*application/json*. If the parameter *returnAsJSON* is set to
*true*, the result will be a JSON object describing the return value
directly, otherwise a string produced by JSON.stringify will be
returned.
Note that this API endpoint will only be present if the server was
started with the option `--javascript.allow-admin-execute true`.
The default value of this option is `false`, which disables the execution of
user-defined code and disables this API endpoint entirely.
This is also the recommended setting for production.
@RESTRETURNCODE{200}
is returned when everything went well, or if a timeout occurred. In the
latter case a body of type application/json indicating the timeout
is returned. depending on *returnAsJSON* this is a json object or a plain string.
@RESTRETURNCODE{403}
is returned if ArangoDB is not running in cluster mode.
@RESTRETURNCODE{404}
is returned if ArangoDB was not compiled for cluster operation.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_api_endpoint.md -->
@startDocuBlock get_api_endpoint
@brief This API call returns the list of all endpoints (single server).
@RESTHEADER{GET /_api/endpoint, Return list of all endpoints, retrieveEndpoints}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
It is considered as deprecated from version 3.4.0 on.
{% endhint %}
@RESTDESCRIPTION
Returns an array of all configured endpoints the server is listening on.
The result is a JSON array of JSON objects, each with `"entrypoint"' as
the only attribute, and with the value being a string describing the
endpoint.
**Note**: retrieving the array of all endpoints is allowed in the system database
only. Calling this action in any other database will make the server return
an error.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned when the array of endpoints can be determined successfully.
@RESTRETURNCODE{400}
is returned if the action is not carried out in the system database.
@RESTRETURNCODE{405}
The server will respond with *HTTP 405* if an unsupported HTTP method is used.
@EXAMPLES
<div class="example-container" id="RestEndpointGet_container">
<a class="anchorjs-link " href="#RestEndpointGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestEndpointGet_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/endpoint</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
{
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"http://127.0.0.1:30361"</span>
}
]
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Administration/get_admin_server_role.md -->
@startDocuBlock get_admin_server_role
@brief Return the role of a server in a cluster
@RESTHEADER{GET /_admin/server/role, Return the role of a server in a cluster, handleRole}
@RESTDESCRIPTION
Returns the role of a server in a cluster.
The role is returned in the *role* attribute of the result.
Possible return values for *role* are:
- *SINGLE*: the server is a standalone server without clustering
- *COORDINATOR*: the server is a Coordinator in a cluster
- *PRIMARY*: the server is a DBServer in a cluster
- *SECONDARY*: this role is not used anymore
- *AGENT*: the server is an Agency node in a cluster
- *UNDEFINED*: in a cluster, *UNDEFINED* is returned if the server role cannot be
determined.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned in all cases.
@RESTREPLYBODY{error,boolean,required,}
always *false*
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code, always 200
@RESTREPLYBODY{errorNum,integer,required,int64}
the server error number
@RESTREPLYBODY{role,string,required,string}
one of [ *SINGLE*, *COORDINATOR*, *PRIMARY*, *SECONDARY*, *AGENT*, *UNDEFINED*]
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Cursors/post_api_cursor_identifier.md -->
@startDocuBlock post_api_cursor_identifier
@brief return the next results from an existing cursor
@RESTHEADER{PUT /_api/cursor/{cursor-identifier}, Read next batch from cursor, modifyQueryCursor}
@RESTURLPARAMETERS
@RESTURLPARAM{cursor-identifier,string,required}
The name of the cursor
@RESTDESCRIPTION
If the cursor is still alive, returns an object with the following
attributes:
- *id*: the *cursor-identifier*
- *result*: a list of documents for the current batch
- *hasMore*: *false* if this was the last batch
- *count*: if present the total number of elements
Note that even if *hasMore* returns *true*, the next call might
still return no documents. If, however, *hasMore* is *false*, then
the cursor is exhausted. Once the *hasMore* attribute has a value of
*false*, the client can stop.
@RESTRETURNCODES
@RESTRETURNCODE{200}
The server will respond with *HTTP 200* in case of success.
@RESTRETURNCODE{400}
If the cursor identifier is omitted, the server will respond with *HTTP 404*.
@RESTRETURNCODE{404}
If no cursor with the specified identifier can be found, the server will respond
with *HTTP 404*.
@EXAMPLES
Valid request for next batch
<div class="example-container" id="RestCursorForLimitReturnCont_container">
<a class="anchorjs-link " href="#RestCursorForLimitReturnCont_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorForLimitReturnCont_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 5 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor/69553</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69547"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69547"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VHK--C"</span>,
<span class="hljs-string">"hello3"</span> : <span class="hljs-string">"world1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69549"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69549"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VHO---"</span>,
<span class="hljs-string">"hello4"</span> : <span class="hljs-string">"world1"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69553"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00010633468627929688</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">2487</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestCursorForLimitReturnCont_container_collapse" onclick="$('#RestCursorForLimitReturnCont_long').hide(); $('#RestCursorForLimitReturnCont_short').show(); window.location.hash='RestCursorForLimitReturnCont_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorForLimitReturnCont_short" onclick="$('#RestCursorForLimitReturnCont_short').hide(); $('#RestCursorForLimitReturnCont_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 5 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor/69553</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Missing identifier
<div class="example-container" id="RestCursorMissingCursorIdentifier_container">
<a class="anchorjs-link " href="#RestCursorMissingCursorIdentifier_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorMissingCursorIdentifier_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"expecting PUT /_api/cursor/&lt;cursor-id&gt;"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">400</span>
}
</pre>
<div id="RestCursorMissingCursorIdentifier_container_collapse" onclick="$('#RestCursorMissingCursorIdentifier_long').hide(); $('#RestCursorMissingCursorIdentifier_short').show(); window.location.hash='RestCursorMissingCursorIdentifier_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorMissingCursorIdentifier_short" onclick="$('#RestCursorMissingCursorIdentifier_short').hide(); $('#RestCursorMissingCursorIdentifier_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Unknown identifier
<div class="example-container" id="RestCursorInvalidCursorIdentifier_container">
<a class="anchorjs-link " href="#RestCursorInvalidCursorIdentifier_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorInvalidCursorIdentifier_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor/123123</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"cursor not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1600</span>
}
</pre>
<div id="RestCursorInvalidCursorIdentifier_container_collapse" onclick="$('#RestCursorInvalidCursorIdentifier_long').hide(); $('#RestCursorInvalidCursorIdentifier_short').show(); window.location.hash='RestCursorInvalidCursorIdentifier_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorInvalidCursorIdentifier_short" onclick="$('#RestCursorInvalidCursorIdentifier_short').hide(); $('#RestCursorInvalidCursorIdentifier_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor/123123</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Cursors/post_api_cursor_delete.md -->
@startDocuBlock post_api_cursor_delete
@brief dispose an existing cursor
@RESTHEADER{DELETE /_api/cursor/{cursor-identifier}, Delete cursor, deleteQueryCursor}
@RESTURLPARAMETERS
@RESTURLPARAM{cursor-identifier,string,required}
The id of the cursor
@RESTDESCRIPTION
Deletes the cursor and frees the resources associated with it.
The cursor will automatically be destroyed on the server when the client has
retrieved all documents from it. The client can also explicitly destroy the
cursor at any earlier time using an HTTP DELETE request. The cursor id must
be included as part of the URL.
Note: the server will also destroy abandoned cursors automatically after a
certain server-controlled timeout to avoid resource leakage.
@RESTRETURNCODES
@RESTRETURNCODE{202}
is returned if the server is aware of the cursor.
@RESTRETURNCODE{404}
is returned if the server is not aware of the cursor. It is also
returned if a cursor is used after it has been destroyed.
@EXAMPLES
<div class="example-container" id="RestCursorDelete_container">
<a class="anchorjs-link " href="#RestCursorDelete_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorDelete_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 5 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69494"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69494"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VF6--A"</span>,
<span class="hljs-string">"hello1"</span> : <span class="hljs-string">"world1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69496"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69496"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VG----"</span>,
<span class="hljs-string">"hello2"</span> : <span class="hljs-string">"world1"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69504"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00012183189392089844</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">2487</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor/69504</span>
</pre>
<div id="RestCursorDelete_container_collapse" onclick="$('#RestCursorDelete_long').hide(); $('#RestCursorDelete_short').show(); window.location.hash='RestCursorDelete_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorDelete_short" onclick="$('#RestCursorDelete_short').hide(); $('#RestCursorDelete_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 5 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor/69504</span>
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Cursors/post_api_cursor.md -->
@startDocuBlock post_api_cursor
@brief create a cursor and return the first results
@RESTHEADER{POST /_api/cursor, Create cursor, createQueryCursor}
A JSON object describing the query and query parameters.
@RESTBODYPARAM{query,string,required,string}
contains the query string to be executed
@RESTBODYPARAM{count,boolean,optional,}
indicates whether the number of documents in the result set should be returned in
the "count" attribute of the result.
Calculating the "count" attribute might have a performance impact for some queries
in the future so this option is turned off by default, and "count"
is only returned when requested.
@RESTBODYPARAM{batchSize,integer,optional,int64}
maximum number of result documents to be transferred from
the server to the client in one roundtrip. If this attribute is
not set, a server-controlled default value will be used. A *batchSize* value of
*0* is disallowed.
@RESTBODYPARAM{ttl,integer,optional,int64}
The time-to-live for the cursor (in seconds). The cursor will be
removed on the server automatically after the specified amount of time. This
is useful to ensure garbage collection of cursors that are not fully fetched
by clients. If not set, a server-defined value will be used (default: 30 seconds).
@RESTBODYPARAM{cache,boolean,optional,}
flag to determine whether the AQL query results cache
shall be used. If set to *false*, then any query cache lookup will be skipped
for the query. If set to *true*, it will lead to the query cache being checked
for the query if the query cache mode is either *on* or *demand*.
@RESTBODYPARAM{memoryLimit,integer,optional,int64}
the maximum number of memory (measured in bytes) that the query is allowed to
use. If set, then the query will fail with error "resource limit exceeded" in
case it allocates too much memory. A value of *0* indicates that there is no
memory limit.
@RESTBODYPARAM{bindVars,array,optional,object}
key/value pairs representing the bind parameters.
@RESTBODYPARAM{options,object,optional,post_api_cursor_opts}
key/value object with extra options for the query.
@RESTSTRUCT{fullCount,post_api_cursor_opts,boolean,optional,}
if set to *true* and the query contains a *LIMIT* clause, then the
result will have an *extra* attribute with the sub-attributes *stats*
and *fullCount*, `{ ... , "extra": { "stats": { "fullCount": 123 } } }`.
The *fullCount* attribute will contain the number of documents in the result before the
last top-level LIMIT in the query was applied. It can be used to count the number of
documents that match certain filter criteria, but only return a subset of them, in one go.
It is thus similar to MySQL's *SQL_CALC_FOUND_ROWS* hint. Note that setting the option
will disable a few LIMIT optimizations and may lead to more documents being processed,
and thus make queries run longer. Note that the *fullCount* attribute may only
be present in the result if the query has a top-level LIMIT clause and the LIMIT
clause is actually used in the query.
@RESTSTRUCT{maxPlans,post_api_cursor_opts,integer,optional,int64}
Limits the maximum number of plans that are created by the AQL query optimizer.
@RESTSTRUCT{maxWarningCount,post_api_cursor_opts,integer,optional,int64}
Limits the maximum number of warnings a query will return. The number of warnings
a query will return is limited to 10 by default, but that number can be increased
or decreased by setting this attribute.
@RESTSTRUCT{failOnWarning,post_api_cursor_opts,boolean,optional,}
When set to *true*, the query will throw an exception and abort instead of producing
a warning. This option should be used during development to catch potential issues
early. When the attribute is set to *false*, warnings will not be propagated to
exceptions and will be returned with the query result.
There is also a server configuration option `--query.fail-on-warning` for setting the
default value for *failOnWarning* so it does not need to be set on a per-query level.
@RESTSTRUCT{stream,post_api_cursor_opts,boolean,optional,}
Specify *true* and the query will be executed in a **streaming** fashion. The query result is
not stored on the server, but calculated on the fly. *Beware*: long-running queries will
need to hold the collection locks for as long as the query cursor exists.
When set to *false* a query will be executed right away in its entirety.
In that case query results are either returned right away (if the result set is small enough),
or stored on the arangod instance and accessible via the cursor API (with respect to the `ttl`).
It is advisable to *only* use this option on short-running queries or without exclusive locks
(write-locks on MMFiles).
Please note that the query options `cache`, `count` and `fullCount` will not work on streaming queries.
Additionally query statistics, warnings and profiling data will only be available after the query is finished.
The default value is *false*
@RESTSTRUCT{optimizer.rules,post_api_cursor_opts,array,optional,string}
A list of to-be-included or to-be-excluded optimizer rules
can be put into this attribute, telling the optimizer to include or exclude
specific rules. To disable a rule, prefix its name with a `-`, to enable a rule, prefix it
with a `+`. There is also a pseudo-rule `all`, which will match all optimizer rules.
@RESTSTRUCT{profile,post_api_cursor_opts,integer,optional,}
If set to *true* or *1*, then the additional query profiling information will be returned
in the sub-attribute *profile* of the *extra* return attribute, if the query result
is not served from the query cache. Set to *2* the query will include execution stats
per query plan node in sub-attribute *stats.nodes* of the *extra* return attribute.
Additionally the query plan is returned in the sub-attribute *extra.plan*.
@RESTSTRUCT{satelliteSyncWait,post_api_cursor_opts,boolean,optional,}
This *Enterprise Edition* parameter allows to configure how long a DBServer will have time
to bring the satellite collections involved in the query into sync.
The default value is *60.0* (seconds). When the max time has been reached the query
will be stopped.
@RESTSTRUCT{maxTransactionSize,post_api_cursor_opts,integer,optional,int64}
Transaction size limit in bytes. Honored by the RocksDB storage engine only.
@RESTSTRUCT{intermediateCommitSize,post_api_cursor_opts,integer,optional,int64}
Maximum total size of operations after which an intermediate commit is performed
automatically. Honored by the RocksDB storage engine only.
@RESTSTRUCT{intermediateCommitCount,post_api_cursor_opts,integer,optional,int64}
Maximum number of operations after which an intermediate commit is performed
automatically. Honored by the RocksDB storage engine only.
@RESTSTRUCT{skipInaccessibleCollections,post_api_cursor_opts,boolean,optional,}
AQL queries (especially graph traversals) will treat collection to which a user has no access rights as if these collections were empty. Instead of returning a forbidden access error, your queries will execute normally. This is intended to help with certain use-cases: A graph contains several collections and different users execute AQL queries on that graph. You can now naturally limit the accessible results by changing the access rights of users on collections. This feature is only available in the Enterprise Edition.
@RESTDESCRIPTION
The query details include the query string plus optional query options and
bind parameters. These values need to be passed in a JSON representation in
the body of the POST request.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the result set can be created by the server.
@RESTREPLYBODY{error,boolean,required,}
A flag to indicate that an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,integer}
the HTTP status code
@RESTREPLYBODY{result,array,optional,}
an array of result documents (might be empty if query has no results)
@RESTREPLYBODY{hasMore,boolean,required,}
A boolean indicator whether there are more results
available for the cursor on the server
@RESTREPLYBODY{count,integer,optional,int64}
the total number of result documents available (only
available if the query was executed with the *count* attribute set)
@RESTREPLYBODY{id,string,required,string}
id of temporary cursor created on the server (optional, see above)
@RESTREPLYBODY{extra,object,optional,}
an optional JSON object with extra information about the query result
contained in its *stats* sub-attribute. For data-modification queries, the
*extra.stats* sub-attribute will contain the number of modified documents and
the number of documents that could not be modified
due to an error (if *ignoreErrors* query option is specified)
@RESTREPLYBODY{cached,boolean,required,}
a boolean flag indicating whether the query result was served
from the query cache or not. If the query result is served from the query
cache, the *extra* return attribute will not contain any *stats* sub-attribute
and no *profile* sub-attribute.
@RESTRETURNCODE{400}
is returned if the JSON representation is malformed or the query specification is
missing from the request.
If the JSON representation is malformed or the query specification is
missing from the request, the server will respond with *HTTP 400*.
The body of the response will contain a JSON object with additional error
details. The object has the following attributes:
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate that an error occurred (*true* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{errorNum,integer,required,int64}
the server error number
@RESTREPLYBODY{errorMessage,string,required,string}
a descriptive error message
If the query specification is complete, the server will process the query. If an
error occurs during query processing, the server will respond with *HTTP 400*.
Again, the body of the response will contain details about the error.
A [list of query errors can be found here](../../Manual/Appendix/ErrorCodes.html).
@RESTRETURNCODE{404}
The server will respond with *HTTP 404* in case a non-existing collection is
accessed in the query.
@RESTRETURNCODE{405}
The server will respond with *HTTP 405* if an unsupported HTTP method is used.
@EXAMPLES
Execute a query and extract the result in a single go
<div class="example-container" id="RestCursorCreateCursorForLimitReturnSingle_container">
<a class="anchorjs-link " href="#RestCursorCreateCursorForLimitReturnSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorCreateCursorForLimitReturnSingle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 2 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69477"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69477"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VFC---"</span>,
<span class="hljs-string">"hello1"</span> : <span class="hljs-string">"world1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69479"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69479"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VFC--A"</span>,
<span class="hljs-string">"hello2"</span> : <span class="hljs-string">"world1"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00013399124145507812</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">2286</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorCreateCursorForLimitReturnSingle_container_collapse" onclick="$('#RestCursorCreateCursorForLimitReturnSingle_long').hide(); $('#RestCursorCreateCursorForLimitReturnSingle_short').show(); window.location.hash='RestCursorCreateCursorForLimitReturnSingle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorCreateCursorForLimitReturnSingle_short" onclick="$('#RestCursorCreateCursorForLimitReturnSingle_short').hide(); $('#RestCursorCreateCursorForLimitReturnSingle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 2 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Execute a query and extract a part of the result
<div class="example-container" id="RestCursorCreateCursorForLimitReturn_container">
<a class="anchorjs-link " href="#RestCursorCreateCursorForLimitReturn_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorCreateCursorForLimitReturn_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 5 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69458"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69458"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VEm--A"</span>,
<span class="hljs-string">"hello1"</span> : <span class="hljs-string">"world1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69460"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69460"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6VEq---"</span>,
<span class="hljs-string">"hello2"</span> : <span class="hljs-string">"world1"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69468"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00030493736267089844</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">2487</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorCreateCursorForLimitReturn_container_collapse" onclick="$('#RestCursorCreateCursorForLimitReturn_long').hide(); $('#RestCursorCreateCursorForLimitReturn_short').show(); window.location.hash='RestCursorCreateCursorForLimitReturn_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorCreateCursorForLimitReturn_short" onclick="$('#RestCursorCreateCursorForLimitReturn_short').hide(); $('#RestCursorCreateCursorForLimitReturn_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LIMIT 5 RETURN p"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using the query option "fullCount"
<div class="example-container" id="RestCursorCreateCursorOption_container">
<a class="anchorjs-link " href="#RestCursorCreateCursorOption_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorCreateCursorOption_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..1000 FILTER i &gt; 500 LIMIT 10 RETURN i"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"fullCount"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
<span class="hljs-number">501</span>,
<span class="hljs-number">502</span>,
<span class="hljs-number">503</span>,
<span class="hljs-number">504</span>,
<span class="hljs-number">505</span>,
<span class="hljs-number">506</span>,
<span class="hljs-number">507</span>,
<span class="hljs-number">508</span>,
<span class="hljs-number">509</span>,
<span class="hljs-number">510</span>
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">500</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"fullCount"</span> : <span class="hljs-number">500</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0005273818969726562</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">75048</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorCreateCursorOption_container_collapse" onclick="$('#RestCursorCreateCursorOption_long').hide(); $('#RestCursorCreateCursorOption_short').show(); window.location.hash='RestCursorCreateCursorOption_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorCreateCursorOption_short" onclick="$('#RestCursorCreateCursorOption_short').hide(); $('#RestCursorCreateCursorOption_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..1000 FILTER i &gt; 500 LIMIT 10 RETURN i"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"fullCount"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Enabling and disabling optimizer rules
<div class="example-container" id="RestCursorOptimizerRules_container">
<a class="anchorjs-link " href="#RestCursorOptimizerRules_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorOptimizerRules_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..10 LET a = 1 LET b = 2 FILTER a + b == 3 RETURN i"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"maxPlans"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"optimizer"</span> : {
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"-all"</span>,
<span class="hljs-string">"+remove-unnecessary-filters"</span>
]
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
<span class="hljs-number">1</span>,
<span class="hljs-number">2</span>,
<span class="hljs-number">3</span>,
<span class="hljs-number">4</span>,
<span class="hljs-number">5</span>,
<span class="hljs-number">6</span>,
<span class="hljs-number">7</span>,
<span class="hljs-number">8</span>,
<span class="hljs-number">9</span>,
<span class="hljs-number">10</span>
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00018358230590820312</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">66968</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorOptimizerRules_container_collapse" onclick="$('#RestCursorOptimizerRules_long').hide(); $('#RestCursorOptimizerRules_short').show(); window.location.hash='RestCursorOptimizerRules_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorOptimizerRules_short" onclick="$('#RestCursorOptimizerRules_short').hide(); $('#RestCursorOptimizerRules_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..10 LET a = 1 LET b = 2 FILTER a + b == 3 RETURN i"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"maxPlans"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"optimizer"</span> : {
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"-all"</span>,
<span class="hljs-string">"+remove-unnecessary-filters"</span>
]
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Execute instrumented query and return result together with
execution plan and profiling information
<div class="example-container" id="RestCursorProfileQuery_container">
<a class="anchorjs-link " href="#RestCursorProfileQuery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorProfileQuery_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"profile"</span> : <span class="hljs-number">2</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"2"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"json"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"function call"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">47</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SLEEP"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"array"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">41</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">0.25</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"double"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">3</span>
}
]
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"s"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"function call"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">47</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"SLEEP"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"array"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">41</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">0.5</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"double"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">3</span>
}
]
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"t"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"2"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>
],
<span class="hljs-string">"collections"</span> : [ ],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"2"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"t"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"s"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.7825753688812256</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">2312</span>,
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"calls"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"items"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"runtime"</span> : <span class="hljs-number">0.0000016689300537109375</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"calls"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"items"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"runtime"</span> : <span class="hljs-number">0.2707178592681885</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"calls"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"items"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"runtime"</span> : <span class="hljs-number">0.7823958396911621</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"calls"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"items"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"runtime"</span> : <span class="hljs-number">0.0000050067901611328125</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"calls"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"items"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"runtime"</span> : <span class="hljs-number">0.7823982238769531</span>
}
]
},
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"profile"</span> : {
<span class="hljs-string">"initializing"</span> : <span class="hljs-number">0.0000016689300537109375</span>,
<span class="hljs-string">"parsing"</span> : <span class="hljs-number">0.0000209808349609375</span>,
<span class="hljs-string">"optimizing ast"</span> : <span class="hljs-number">0.000003337860107421875</span>,
<span class="hljs-string">"loading collections"</span> : <span class="hljs-number">0.0000035762786865234375</span>,
<span class="hljs-string">"instantiating plan"</span> : <span class="hljs-number">0.00000762939453125</span>,
<span class="hljs-string">"optimizing plan"</span> : <span class="hljs-number">0.00003504753112792969</span>,
<span class="hljs-string">"executing"</span> : <span class="hljs-number">0.7824089527130127</span>,
<span class="hljs-string">"finalizing"</span> : <span class="hljs-number">0.00008845329284667969</span>
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorProfileQuery_container_collapse" onclick="$('#RestCursorProfileQuery_long').hide(); $('#RestCursorProfileQuery_short').show(); window.location.hash='RestCursorProfileQuery_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorProfileQuery_short" onclick="$('#RestCursorProfileQuery_short').hide(); $('#RestCursorProfileQuery_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"LET s = SLEEP(0.25) LET t = SLEEP(0.5) RETURN 1"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"profile"</span> : <span class="hljs-number">2</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Execute a data-modification query and retrieve the number of
modified documents
<div class="example-container" id="RestCursorDeleteQuery_container">
<a class="anchorjs-link " href="#RestCursorDeleteQuery_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorDeleteQuery_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products REMOVE p IN products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [ ],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0002765655517578125</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">34152</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorDeleteQuery_container_collapse" onclick="$('#RestCursorDeleteQuery_long').hide(); $('#RestCursorDeleteQuery_short').show(); window.location.hash='RestCursorDeleteQuery_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorDeleteQuery_short" onclick="$('#RestCursorDeleteQuery_short').hide(); $('#RestCursorDeleteQuery_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products REMOVE p IN products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Execute a data-modification query with option *ignoreErrors*
<div class="example-container" id="RestCursorDeleteIgnore_container">
<a class="anchorjs-link " href="#RestCursorDeleteIgnore_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorDeleteIgnore_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"REMOVE 'bar' IN products OPTIONS { ignoreErrors: true }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [ ],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0002086162567138672</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">17944</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCursorDeleteIgnore_container_collapse" onclick="$('#RestCursorDeleteIgnore_long').hide(); $('#RestCursorDeleteIgnore_short').show(); window.location.hash='RestCursorDeleteIgnore_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorDeleteIgnore_short" onclick="$('#RestCursorDeleteIgnore_short').hide(); $('#RestCursorDeleteIgnore_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"REMOVE 'bar' IN products OPTIONS { ignoreErrors: true }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Bad query - Missing body
<div class="example-container" id="RestCursorCreateCursorMissingBody_container">
<a class="anchorjs-link " href="#RestCursorCreateCursorMissingBody_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorCreateCursorMissingBody_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"query is empty"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1502</span>
}
</pre>
<div id="RestCursorCreateCursorMissingBody_container_collapse" onclick="$('#RestCursorCreateCursorMissingBody_long').hide(); $('#RestCursorCreateCursorMissingBody_short').show(); window.location.hash='RestCursorCreateCursorMissingBody_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorCreateCursorMissingBody_short" onclick="$('#RestCursorCreateCursorMissingBody_short').hide(); $('#RestCursorCreateCursorMissingBody_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/cursor</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Bad query - Unknown collection
<div class="example-container" id="RestCursorCreateCursorUnknownCollection_container">
<a class="anchorjs-link " href="#RestCursorCreateCursorUnknownCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorCreateCursorUnknownCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR u IN unknowncoll LIMIT 2 RETURN u"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"AQL: collection or view not found: unknowncoll (while parsing)"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestCursorCreateCursorUnknownCollection_container_collapse" onclick="$('#RestCursorCreateCursorUnknownCollection_long').hide(); $('#RestCursorCreateCursorUnknownCollection_short').show(); window.location.hash='RestCursorCreateCursorUnknownCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorCreateCursorUnknownCollection_short" onclick="$('#RestCursorCreateCursorUnknownCollection_short').hide(); $('#RestCursorCreateCursorUnknownCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR u IN unknowncoll LIMIT 2 RETURN u"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"batchSize"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Bad query - Execute a data-modification query that attempts to remove a non-existing
document
<div class="example-container" id="RestCursorDeleteQueryFail_container">
<a class="anchorjs-link " href="#RestCursorDeleteQueryFail_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCursorDeleteQueryFail_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"REMOVE 'foo' IN products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"AQL: document not found (while executing)"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1202</span>
}
</pre>
<div id="RestCursorDeleteQueryFail_container_collapse" onclick="$('#RestCursorDeleteQueryFail_long').hide(); $('#RestCursorDeleteQueryFail_short').show(); window.location.hash='RestCursorDeleteQueryFail_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCursorDeleteQueryFail_short" onclick="$('#RestCursorDeleteQueryFail_short').hide(); $('#RestCursorDeleteQueryFail_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/cursor</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"REMOVE 'foo' IN products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/get_read_document.md -->
@startDocuBlock get_read_document
@brief reads a single document
@RESTHEADER{GET /_api/document/{document-handle},Read document, readDocument}
@RESTURLPARAMETERS
@RESTURLPARAM{document-handle,string,required}
The handle of the document.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{If-None-Match,string,optional}
If the "If-None-Match" header is given, then it must contain exactly one
Etag. The document is returned, if it has a different revision than the
given Etag. Otherwise an *HTTP 304* is returned.
@RESTHEADERPARAM{If-Match,string,optional}
If the "If-Match" header is given, then it must contain exactly one
Etag. The document is returned, if it has the same revision as the
given Etag. Otherwise a *HTTP 412* is returned.
@RESTDESCRIPTION
Returns the document identified by *document-handle*. The returned
document contains three special attributes: *_id* containing the document
handle, *_key* containing key which uniquely identifies a document
in a given collection and *_rev* containing the revision.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the document was found
@RESTRETURNCODE{304}
is returned if the "If-None-Match" header is given and the document has
the same version
@RESTRETURNCODE{404}
is returned if the document or collection was not found
@RESTRETURNCODE{412}
is returned if an "If-Match" header is given and the found
document has a different version. The response will also contain the found
document's current revision in the *_rev* attribute. Additionally, the
attributes *_id* and *_key* will be returned.
@EXAMPLES
Use a document handle:
<div class="example-container" id="RestDocumentHandlerReadDocument_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocument_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocument_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69874</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WGm---"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69874"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69874"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WGm---"</span>,
<span class="hljs-string">"hello"</span> : <span class="hljs-string">"world"</span>
}
</pre>
<div id="RestDocumentHandlerReadDocument_container_collapse" onclick="$('#RestDocumentHandlerReadDocument_long').hide(); $('#RestDocumentHandlerReadDocument_short').show(); window.location.hash='RestDocumentHandlerReadDocument_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerReadDocument_short" onclick="$('#RestDocumentHandlerReadDocument_short').hide(); $('#RestDocumentHandlerReadDocument_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69874</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WGm---"</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Use a document handle and an Etag:
<div class="example-container" id="RestDocumentHandlerReadDocumentIfNoneMatch_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentIfNoneMatch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentIfNoneMatch_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'If-None-Match: "_ZXF6WHm--A"'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69923</span>
</pre>
</div>
</div>
Unknown document handle:
<div class="example-container" id="RestDocumentHandlerReadDocumentUnknownHandle_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentUnknownHandle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentUnknownHandle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/unknownhandle</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found: products"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestDocumentHandlerReadDocumentUnknownHandle_container_collapse" onclick="$('#RestDocumentHandlerReadDocumentUnknownHandle_long').hide(); $('#RestDocumentHandlerReadDocumentUnknownHandle_short').show(); window.location.hash='RestDocumentHandlerReadDocumentUnknownHandle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerReadDocumentUnknownHandle_short" onclick="$('#RestDocumentHandlerReadDocumentUnknownHandle_short').hide(); $('#RestDocumentHandlerReadDocumentUnknownHandle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/unknownhandle</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/put_replace_multiple_documents.md -->
@startDocuBlock put_replace_document_MULTI
@brief replaces multiple documents
@RESTHEADER{PUT /_api/document/{collection},Replace documents, replaceDocument:multiple}
@RESTALLBODYPARAM{documents,json,required}
A JSON representation of an array of documents.
@RESTURLPARAMETERS
@RESTURLPARAM{collection,string,required}
This URL parameter is the name of the collection in which the
documents are replaced.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until the new documents have been synced to disk.
@RESTQUERYPARAM{ignoreRevs,boolean,optional}
By default, or if this is set to *true*, the *_rev* attributes in
the given documents are ignored. If this is set to *false*, then
any *_rev* attribute given in a body document is taken as a
precondition. The document is only replaced if the current revision
is the one specified.
@RESTQUERYPARAM{returnOld,boolean,optional}
Return additionally the complete previous revision of the changed
documents under the attribute *old* in the result.
@RESTQUERYPARAM{returnNew,boolean,optional}
Return additionally the complete new documents under the attribute *new*
in the result.
@RESTDESCRIPTION
Replaces multiple documents in the specified collection with the
ones in the body, the replaced documents are specified by the *_key*
attributes in the body documents.
If *ignoreRevs* is *false* and there is a *_rev* attribute in a
document in the body and its value does not match the revision of
the corresponding document in the database, the precondition is
violated.
If the document exists and can be updated, then an *HTTP 201* or
an *HTTP 202* is returned (depending on *waitForSync*, see below).
Optionally, the query parameter *waitForSync* can be used to force
synchronization of the document replacement operation to disk even in case
that the *waitForSync* flag had been disabled for the entire collection.
Thus, the *waitForSync* query parameter can be used to force synchronization
of just specific operations. To use this, set the *waitForSync* parameter
to *true*. If the *waitForSync* parameter is not specified or set to
*false*, then the collection's default *waitForSync* behavior is
applied. The *waitForSync* query parameter cannot be used to disable
synchronization for collections that have a default *waitForSync* value
of *true*.
The body of the response contains a JSON array of the same length
as the input array with the information about the handle and the
revision of the replaced documents. In each entry, the attribute
*_id* contains the known *document-handle* of each updated document,
*_key* contains the key which uniquely identifies a document in a
given collection, and the attribute *_rev* contains the new document
revision. In case of an error or violated precondition, an error
object with the attribute *error* set to *true* and the attribute
*errorCode* set to the error code is built.
If the query parameter *returnOld* is *true*, then, for each
generated document, the complete previous revision of the document
is returned under the *old* attribute in the result.
If the query parameter *returnNew* is *true*, then, for each
generated document, the complete new document is returned under
the *new* attribute in the result.
Note that if any precondition is violated or an error occurred with
some of the documents, the return code is still 201 or 202, but
the additional HTTP header *X-Arango-Error-Codes* is set, which
contains a map of the error codes that occurred together with their
multiplicities, as in: *1200:17,1205:10* which means that in 17
cases the error 1200 "revision conflict" and in 10 cases the error
1205 "illegal document handle" has happened.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the documents were replaced successfully and
*waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if the documents were replaced successfully and
*waitForSync* was *false*.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation
of an array of documents. The response body contains
an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection was not found.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/delete_mutliple_documents.md -->
@startDocuBlock delete_remove_document_MULTI
@brief removes multiple document
@RESTHEADER{DELETE /_api/document/{collection},Removes multiple documents, removeDocument}
@RESTALLBODYPARAM{array,json,required}
A JSON array of strings or documents.
@RESTURLPARAMETERS
@RESTURLPARAM{collection,string,required}
Collection from which documents are removed.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until deletion operation has been synced to disk.
@RESTQUERYPARAM{returnOld,boolean,optional}
Return additionally the complete previous revision of the changed
document under the attribute *old* in the result.
@RESTQUERYPARAM{ignoreRevs,boolean,optional}
If set to *true*, ignore any *_rev* attribute in the selectors. No
revision check is performed.
@RESTDESCRIPTION
The body of the request is an array consisting of selectors for
documents. A selector can either be a string with a key or a string
with a document handle or an object with a *_key* attribute. This
API call removes all specified documents from *collection*. If the
selector is an object and has a *_rev* attribute, it is a
precondition that the actual revision of the removed document in the
collection is the specified one.
The body of the response is an array of the same length as the input
array. For each input selector, the output contains a JSON object
with the information about the outcome of the operation. If no error
occurred, an object is built in which the attribute *_id* contains
the known *document-handle* of the removed document, *_key* contains
the key which uniquely identifies a document in a given collection,
and the attribute *_rev* contains the document revision. In case of
an error, an object with the attribute *error* set to *true* and
*errorCode* set to the error code is built.
If the *waitForSync* parameter is not specified or set to *false*,
then the collection's default *waitForSync* behavior is applied.
The *waitForSync* query parameter cannot be used to disable
synchronization for collections that have a default *waitForSync*
value of *true*.
If the query parameter *returnOld* is *true*, then
the complete previous revision of the document
is returned under the *old* attribute in the result.
Note that if any precondition is violated or an error occurred with
some of the documents, the return code is still 200 or 202, but
the additional HTTP header *X-Arango-Error-Codes* is set, which
contains a map of the error codes that occurred together with their
multiplicities, as in: *1200:17,1205:10* which means that in 17
cases the error 1200 "revision conflict" and in 10 cases the error
1205 "illegal document handle" has happened.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if *waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if *waitForSync* was *false*.
@RESTRETURNCODE{404}
is returned if the collection was not found.
The response body contains an error document in this case.
@EXAMPLES
Using document handle:
<div class="example-container" id="RestDocumentHandlerDeleteDocumentMulti_container">
<a class="anchorjs-link " href="#RestDocumentHandlerDeleteDocumentMulti_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerDeleteDocumentMulti_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69749</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WAS--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69749</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69749"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69749"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WAS--A"</span>
}
</pre>
<div id="RestDocumentHandlerDeleteDocumentMulti_container_collapse" onclick="$('#RestDocumentHandlerDeleteDocumentMulti_long').hide(); $('#RestDocumentHandlerDeleteDocumentMulti_short').show(); window.location.hash='RestDocumentHandlerDeleteDocumentMulti_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerDeleteDocumentMulti_short" onclick="$('#RestDocumentHandlerDeleteDocumentMulti_short').hide(); $('#RestDocumentHandlerDeleteDocumentMulti_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69749</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WAS--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69749</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Unknown document handle:
<div class="example-container" id="RestDocumentHandlerDeleteDocumentUnknownHandleMulti_container">
<a class="anchorjs-link " href="#RestDocumentHandlerDeleteDocumentUnknownHandleMulti_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerDeleteDocumentUnknownHandleMulti_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69770</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"document not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1202</span>
}
</pre>
<div id="RestDocumentHandlerDeleteDocumentUnknownHandleMulti_container_collapse" onclick="$('#RestDocumentHandlerDeleteDocumentUnknownHandleMulti_long').hide(); $('#RestDocumentHandlerDeleteDocumentUnknownHandleMulti_short').show(); window.location.hash='RestDocumentHandlerDeleteDocumentUnknownHandleMulti_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerDeleteDocumentUnknownHandleMulti_short" onclick="$('#RestDocumentHandlerDeleteDocumentUnknownHandleMulti_short').hide(); $('#RestDocumentHandlerDeleteDocumentUnknownHandleMulti_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69770</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Revision conflict:
<div class="example-container" id="RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_container">
<a class="anchorjs-link " href="#RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'If-Match: "_ZXF6WA---C"'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69737</span>
HTTP/<span class="hljs-number">1.1</span> Precondition Failed
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WA---A"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">412</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1200</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"precondition failed"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69737"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69737"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WA---A"</span>
}
</pre>
<div id="RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_container_collapse" onclick="$('#RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_long').hide(); $('#RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_short').show(); window.location.hash='RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_short" onclick="$('#RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_short').hide(); $('#RestDocumentHandlerDeleteDocumentIfMatchOtherMulti_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'If-Match: "_ZXF6WA---C"'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69737</span>
HTTP/<span class="hljs-number">1.1</span> Precondition Failed
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WA---A"</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/put_replace_document.md -->
@startDocuBlock put_replace_document
@brief replaces a document
@RESTHEADER{PUT /_api/document/{document-handle},Replace document, replaceDocument}
@RESTALLBODYPARAM{document,json,required}
A JSON representation of a single document.
@RESTURLPARAMETERS
@RESTURLPARAM{document-handle,string,required}
This URL parameter must be a document handle.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until document has been synced to disk.
@RESTQUERYPARAM{ignoreRevs,boolean,optional}
By default, or if this is set to *true*, the *_rev* attributes in
the given document is ignored. If this is set to *false*, then
the *_rev* attribute given in the body document is taken as a
precondition. The document is only replaced if the current revision
is the one specified.
@RESTQUERYPARAM{returnOld,boolean,optional}
Return additionally the complete previous revision of the changed
document under the attribute *old* in the result.
@RESTQUERYPARAM{returnNew,boolean,optional}
Return additionally the complete new document under the attribute *new*
in the result.
@RESTQUERYPARAM{silent,boolean,optional}
If set to *true*, an empty object will be returned as response. No meta-data
will be returned for the replaced document. This option can be used to
save some network traffic.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{If-Match,string,optional}
You can conditionally replace a document based on a target revision id by
using the *if-match* HTTP header.
@RESTDESCRIPTION
Replaces the document with handle <document-handle> with the one in
the body, provided there is such a document and no precondition is
violated.
If the *If-Match* header is specified and the revision of the
document in the database is unequal to the given revision, the
precondition is violated.
If *If-Match* is not given and *ignoreRevs* is *false* and there
is a *_rev* attribute in the body and its value does not match
the revision of the document in the database, the precondition is
violated.
If a precondition is violated, an *HTTP 412* is returned.
If the document exists and can be updated, then an *HTTP 201* or
an *HTTP 202* is returned (depending on *waitForSync*, see below),
the *Etag* header field contains the new revision of the document
and the *Location* header contains a complete URL under which the
document can be queried.
Optionally, the query parameter *waitForSync* can be used to force
synchronization of the document replacement operation to disk even in case
that the *waitForSync* flag had been disabled for the entire collection.
Thus, the *waitForSync* query parameter can be used to force synchronization
of just specific operations. To use this, set the *waitForSync* parameter
to *true*. If the *waitForSync* parameter is not specified or set to
*false*, then the collection's default *waitForSync* behavior is
applied. The *waitForSync* query parameter cannot be used to disable
synchronization for collections that have a default *waitForSync* value
of *true*.
If *silent* is not set to *true*, the body of the response contains a JSON
object with the information about the handle and the revision. The attribute
*_id* contains the known *document-handle* of the updated document, *_key*
contains the key which uniquely identifies a document in a given collection,
and the attribute *_rev* contains the new document revision.
If the query parameter *returnOld* is *true*, then
the complete previous revision of the document
is returned under the *old* attribute in the result.
If the query parameter *returnNew* is *true*, then
the complete new document is returned under
the *new* attribute in the result.
If the document does not exist, then a *HTTP 404* is returned and the
body of the response contains an error document.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the document was replaced successfully and
*waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if the document was replaced successfully and
*waitForSync* was *false*.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation
of a document. The response body contains
an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection or the document was not found.
@RESTRETURNCODE{412}
is returned if the precondition was violated. The response will
also contain the found documents' current revisions in the *_rev*
attributes. Additionally, the attributes *_id* and *_key* will be
returned.
@EXAMPLES
Using a document handle
<div class="example-container" id="RestDocumentHandlerUpdateDocument_container">
<a class="anchorjs-link " href="#RestDocumentHandlerUpdateDocument_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerUpdateDocument_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69935</span> &lt;&lt;EOF
{"Hello": "you"}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WH6--D"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69935</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69935"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69935"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WH6--D"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6WH6--A"</span>
}
</pre>
<div id="RestDocumentHandlerUpdateDocument_container_collapse" onclick="$('#RestDocumentHandlerUpdateDocument_long').hide(); $('#RestDocumentHandlerUpdateDocument_short').show(); window.location.hash='RestDocumentHandlerUpdateDocument_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerUpdateDocument_short" onclick="$('#RestDocumentHandlerUpdateDocument_short').hide(); $('#RestDocumentHandlerUpdateDocument_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69935</span> &lt;&lt;EOF
{"Hello": "you"}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WH6--D"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69935</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Unknown document handle
<div class="example-container" id="RestDocumentHandlerUpdateDocumentUnknownHandle_container">
<a class="anchorjs-link " href="#RestDocumentHandlerUpdateDocumentUnknownHandle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerUpdateDocumentUnknownHandle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69957</span> &lt;&lt;EOF
{}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"document not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1202</span>
}
</pre>
<div id="RestDocumentHandlerUpdateDocumentUnknownHandle_container_collapse" onclick="$('#RestDocumentHandlerUpdateDocumentUnknownHandle_long').hide(); $('#RestDocumentHandlerUpdateDocumentUnknownHandle_short').show(); window.location.hash='RestDocumentHandlerUpdateDocumentUnknownHandle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerUpdateDocumentUnknownHandle_short" onclick="$('#RestDocumentHandlerUpdateDocumentUnknownHandle_short').hide(); $('#RestDocumentHandlerUpdateDocumentUnknownHandle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69957</span> &lt;&lt;EOF
{}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Produce a revision conflict
<div class="example-container" id="RestDocumentHandlerUpdateDocumentIfMatchOther_container">
<a class="anchorjs-link " href="#RestDocumentHandlerUpdateDocumentIfMatchOther_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerUpdateDocumentIfMatchOther_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'If-Match: "_ZXF6WIK---"'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69945</span> &lt;&lt;EOF
{"other":"content"}
EOF
HTTP/<span class="hljs-number">1.1</span> Precondition Failed
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WIG--A"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">412</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1200</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"precondition failed"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69945"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69945"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WIG--A"</span>
}
</pre>
<div id="RestDocumentHandlerUpdateDocumentIfMatchOther_container_collapse" onclick="$('#RestDocumentHandlerUpdateDocumentIfMatchOther_long').hide(); $('#RestDocumentHandlerUpdateDocumentIfMatchOther_short').show(); window.location.hash='RestDocumentHandlerUpdateDocumentIfMatchOther_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerUpdateDocumentIfMatchOther_short" onclick="$('#RestDocumentHandlerUpdateDocumentIfMatchOther_short').hide(); $('#RestDocumentHandlerUpdateDocumentIfMatchOther_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'If-Match: "_ZXF6WIK---"'</span> --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69945</span> &lt;&lt;EOF
{"other":"content"}
EOF
HTTP/<span class="hljs-number">1.1</span> Precondition Failed
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WIG--A"</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/post_create_document.md -->
@startDocuBlock post_create_document
@brief creates documents
@RESTHEADER{POST /_api/document/{collection}, Create document, insertDocument}
@RESTURLPARAMETERS
@RESTURLPARAM{collection,string,required}
The *collection* in which the collection is to be created.
@RESTALLBODYPARAM{data,json,required}
A JSON representation of a single document or of an array of documents.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,optional}
The name of the collection. This is only for backward compatibility.
In ArangoDB versions < 3.0, the URL path was */_api/document* and
this query parameter was required. This combination still works, but
the recommended way is to specify the collection in the URL path.
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until document has been synced to disk.
@RESTQUERYPARAM{returnNew,boolean,optional}
Additionally return the complete new document under the attribute *new*
in the result.
@RESTQUERYPARAM{returnOld,boolean,optional}
Additionally return the complete old document under the attribute *old*
in the result. Only available if the overwrite option is used.
@RESTQUERYPARAM{silent,boolean,optional}
If set to *true*, an empty object will be returned as response. No meta-data
will be returned for the created document. This option can be used to
save some network traffic.
@RESTQUERYPARAM{overwrite,boolean,optional}
If set to *true*, the insert becomes a replace-insert. If a document with the
same *_key* already exists the new document is not rejected with unique
constraint violated but will replace the old document.
@RESTDESCRIPTION
Creates a new document from the document given in the body, unless there
is already a document with the *_key* given. If no *_key* is given, a new
unique *_key* is generated automatically.
The body can be an array of documents, in which case all
documents in the array are inserted with the same semantics as for a
single document. The result body will contain a JSON array of the
same length as the input array, and each entry contains the result
of the operation for the corresponding input. In case of an error
the entry is a document with attributes *error* set to *true* and
errorCode set to the error code that has happened.
Possibly given *_id* and *_rev* attributes in the body are always ignored,
the URL part or the query parameter collection respectively counts.
If the document was created successfully, then the *Location* header
contains the path to the newly created document. The *Etag* header field
contains the revision of the document. Both are only set in the single
document case.
If *silent* is not set to *true*, the body of the response contains a
JSON object (single document case) with the following attributes:
- *_id* contains the document handle of the newly created document
- *_key* contains the document key
- *_rev* contains the document revision
In the multi case the body is an array of such objects.
If the collection parameter *waitForSync* is *false*, then the call
returns as soon as the document has been accepted. It will not wait
until the documents have been synced to disk.
Optionally, the query parameter *waitForSync* can be used to force
synchronization of the document creation operation to disk even in
case that the *waitForSync* flag had been disabled for the entire
collection. Thus, the *waitForSync* query parameter can be used to
force synchronization of just this specific operations. To use this,
set the *waitForSync* parameter to *true*. If the *waitForSync*
parameter is not specified or set to *false*, then the collection's
default *waitForSync* behavior is applied. The *waitForSync* query
parameter cannot be used to disable synchronization for collections
that have a default *waitForSync* value of *true*.
If the query parameter *returnNew* is *true*, then, for each
generated document, the complete new document is returned under
the *new* attribute in the result.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the documents were created successfully and
*waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if the documents were created successfully and
*waitForSync* was *false*.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation
of one document or an array of documents. The response body contains
an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown.
The response body contains an error document in this case.
@RESTRETURNCODE{409}
is returned in the single document case if a document with the
same qualifiers in an indexed attribute conflicts with an already
existing document and thus violates that unique constraint. The
response body contains an error document in this case. In the array
case only 201 or 202 is returned, but if an error occurred, the
additional HTTP header *X-Arango-Error-Codes* is set, which
contains a map of the error codes that occurred together with their
multiplicities, as in: *1205:10,1210:17* which means that in 10
cases the error 1205 "illegal document handle" and in 17 cases the
error 1210 "unique constraint violated" has happened.
@EXAMPLES
Create a document in a collection named *products*. Note that the
revision identifier might or might not by equal to the auto-generated
key.
<div class="example-container" id="RestDocumentHandlerPostCreate1_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostCreate1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostCreate1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WEi--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69825</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69825"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69825"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WEi--A"</span>
}
</pre>
<div id="RestDocumentHandlerPostCreate1_container_collapse" onclick="$('#RestDocumentHandlerPostCreate1_long').hide(); $('#RestDocumentHandlerPostCreate1_short').show(); window.location.hash='RestDocumentHandlerPostCreate1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostCreate1_short" onclick="$('#RestDocumentHandlerPostCreate1_short').hide(); $('#RestDocumentHandlerPostCreate1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WEi--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69825</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Create a document in a collection named *products* with a collection-level
*waitForSync* value of *false*.
<div class="example-container" id="RestDocumentHandlerPostAccept1_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostAccept1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostAccept1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WEK--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69809</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69809"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69809"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WEK--A"</span>
}
</pre>
<div id="RestDocumentHandlerPostAccept1_container_collapse" onclick="$('#RestDocumentHandlerPostAccept1_long').hide(); $('#RestDocumentHandlerPostAccept1_short').show(); window.location.hash='RestDocumentHandlerPostAccept1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostAccept1_short" onclick="$('#RestDocumentHandlerPostAccept1_short').hide(); $('#RestDocumentHandlerPostAccept1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WEK--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69809</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Create a document in a collection with a collection-level *waitForSync*
value of *false*, but using the *waitForSync* query parameter.
<div class="example-container" id="RestDocumentHandlerPostWait1_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostWait1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostWait1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products?waitForSync=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WGK--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69865</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69865"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69865"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WGK--A"</span>
}
</pre>
<div id="RestDocumentHandlerPostWait1_container_collapse" onclick="$('#RestDocumentHandlerPostWait1_long').hide(); $('#RestDocumentHandlerPostWait1_short').show(); window.location.hash='RestDocumentHandlerPostWait1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostWait1_short" onclick="$('#RestDocumentHandlerPostWait1_short').hide(); $('#RestDocumentHandlerPostWait1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products?waitForSync=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WGK--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69865</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Unknown collection name
<div class="example-container" id="RestDocumentHandlerPostUnknownCollection1_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostUnknownCollection1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostUnknownCollection1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found: products"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestDocumentHandlerPostUnknownCollection1_container_collapse" onclick="$('#RestDocumentHandlerPostUnknownCollection1_long').hide(); $('#RestDocumentHandlerPostUnknownCollection1_short').show(); window.location.hash='RestDocumentHandlerPostUnknownCollection1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostUnknownCollection1_short" onclick="$('#RestDocumentHandlerPostUnknownCollection1_short').hide(); $('#RestDocumentHandlerPostUnknownCollection1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Illegal document
<div class="example-container" id="RestDocumentHandlerPostBadJson1_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostBadJson1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostBadJson1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ 1: "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"VPackError error: Expecting '\"' or '}'"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">600</span>
}
</pre>
<div id="RestDocumentHandlerPostBadJson1_container_collapse" onclick="$('#RestDocumentHandlerPostBadJson1_long').hide(); $('#RestDocumentHandlerPostBadJson1_short').show(); window.location.hash='RestDocumentHandlerPostBadJson1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostBadJson1_short" onclick="$('#RestDocumentHandlerPostBadJson1_short').hide(); $('#RestDocumentHandlerPostBadJson1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ 1: "World" }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Insert multiple documents:
<div class="example-container" id="RestDocumentHandlerPostMulti1_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostMulti1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostMulti1_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
[{"Hello":"Earth"}, {"Hello":"Venus"}, {"Hello":"Mars"}]
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69834"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69834"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WE2--A"</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69835"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69835"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WE2--C"</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69836"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69836"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WE2--E"</span>
}
]
</pre>
</div>
</div>
Use of returnNew:
<div class="example-container" id="RestDocumentHandlerPostMulti2_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostMulti2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostMulti2_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products?returnNew=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{"Hello":"World"}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WFC--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69845</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69845"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69845"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WFC--A"</span>,
<span class="hljs-string">"new"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69845"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69845"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WFC--A"</span>,
<span class="hljs-string">"Hello"</span> : <span class="hljs-string">"World"</span>
}
}
</pre>
<div id="RestDocumentHandlerPostMulti2_container_collapse" onclick="$('#RestDocumentHandlerPostMulti2_long').hide(); $('#RestDocumentHandlerPostMulti2_short').show(); window.location.hash='RestDocumentHandlerPostMulti2_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostMulti2_short" onclick="$('#RestDocumentHandlerPostMulti2_short').hide(); $('#RestDocumentHandlerPostMulti2_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products?returnNew=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{"Hello":"World"}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WFC--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69845</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
<div class="example-container" id="RestDocumentHandlerPostOverwrite_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPostOverwrite_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPostOverwrite_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World", "_key" : "lock" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WFO--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/lock
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/lock"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"lock"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WFO--A"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products?overwrite=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "Hello": "Universe", "_key" : "lock" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WFa--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/lock
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/lock"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"lock"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WFa--A"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6WFO--A"</span>
}
</pre>
<div id="RestDocumentHandlerPostOverwrite_container_collapse" onclick="$('#RestDocumentHandlerPostOverwrite_long').hide(); $('#RestDocumentHandlerPostOverwrite_short').show(); window.location.hash='RestDocumentHandlerPostOverwrite_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPostOverwrite_short" onclick="$('#RestDocumentHandlerPostOverwrite_short').hide(); $('#RestDocumentHandlerPostOverwrite_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products</span> &lt;&lt;EOF
{ "Hello": "World", "_key" : "lock" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WFO--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/lock
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products?overwrite=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{ "Hello": "Universe", "_key" : "lock" }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WFa--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/lock
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/delete_remove_document.md -->
@startDocuBlock delete_remove_document
@brief removes a document
@RESTHEADER{DELETE /_api/document/{document-handle}, Removes a document, removeDocument}
@RESTURLPARAMETERS
@RESTURLPARAM{document-handle,string,required}
Removes the document identified by *document-handle*.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until deletion operation has been synced to disk.
@RESTQUERYPARAM{returnOld,boolean,optional}
Return additionally the complete previous revision of the changed
document under the attribute *old* in the result.
@RESTQUERYPARAM{silent,boolean,optional}
If set to *true*, an empty object will be returned as response. No meta-data
will be returned for the removed document. This option can be used to
save some network traffic.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{If-Match,string,optional}
You can conditionally remove a document based on a target revision id by
using the *if-match* HTTP header.
@RESTDESCRIPTION
If *silent* is not set to *true*, the body of the response contains a JSON
object with the information about the handle and the revision. The attribute
*_id* contains the known *document-handle* of the removed document, *_key*
contains the key which uniquely identifies a document in a given collection,
and the attribute *_rev* contains the document revision.
If the *waitForSync* parameter is not specified or set to *false*,
then the collection's default *waitForSync* behavior is applied.
The *waitForSync* query parameter cannot be used to disable
synchronization for collections that have a default *waitForSync*
value of *true*.
If the query parameter *returnOld* is *true*, then
the complete previous revision of the document
is returned under the *old* attribute in the result.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the document was removed successfully and
*waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if the document was removed successfully and
*waitForSync* was *false*.
@RESTRETURNCODE{404}
is returned if the collection or the document was not found.
The response body contains an error document in this case.
@RESTRETURNCODE{412}
is returned if a "If-Match" header or *rev* is given and the found
document has a different version. The response will also contain the found
document's current revision in the *_rev* attribute. Additionally, the
attributes *_id* and *_key* will be returned.
@EXAMPLES
Using document handle:
<div class="example-container" id="RestDocumentHandlerDeleteDocument_container">
<a class="anchorjs-link " href="#RestDocumentHandlerDeleteDocument_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerDeleteDocument_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69715</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6W-6--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69715</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69715"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69715"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6W-6--A"</span>
}
</pre>
<div id="RestDocumentHandlerDeleteDocument_container_collapse" onclick="$('#RestDocumentHandlerDeleteDocument_long').hide(); $('#RestDocumentHandlerDeleteDocument_short').show(); window.location.hash='RestDocumentHandlerDeleteDocument_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerDeleteDocument_short" onclick="$('#RestDocumentHandlerDeleteDocument_short').hide(); $('#RestDocumentHandlerDeleteDocument_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69715</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6W-6--A"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69715</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Unknown document handle:
<div class="example-container" id="RestDocumentHandlerDeleteDocumentUnknownHandle_container">
<a class="anchorjs-link " href="#RestDocumentHandlerDeleteDocumentUnknownHandle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerDeleteDocumentUnknownHandle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69759</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"document not found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1202</span>
}
</pre>
<div id="RestDocumentHandlerDeleteDocumentUnknownHandle_container_collapse" onclick="$('#RestDocumentHandlerDeleteDocumentUnknownHandle_long').hide(); $('#RestDocumentHandlerDeleteDocumentUnknownHandle_short').show(); window.location.hash='RestDocumentHandlerDeleteDocumentUnknownHandle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerDeleteDocumentUnknownHandle_short" onclick="$('#RestDocumentHandlerDeleteDocumentUnknownHandle_short').hide(); $('#RestDocumentHandlerDeleteDocumentUnknownHandle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69759</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Revision conflict:
<div class="example-container" id="RestDocumentHandlerDeleteDocumentIfMatchOther_container">
<a class="anchorjs-link " href="#RestDocumentHandlerDeleteDocumentIfMatchOther_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerDeleteDocumentIfMatchOther_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'If-Match: "_ZXF6W_u--C"'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69725</span>
HTTP/<span class="hljs-number">1.1</span> Precondition Failed
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6W_u--A"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">412</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1200</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"precondition failed"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69725"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69725"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6W_u--A"</span>
}
</pre>
<div id="RestDocumentHandlerDeleteDocumentIfMatchOther_container_collapse" onclick="$('#RestDocumentHandlerDeleteDocumentIfMatchOther_long').hide(); $('#RestDocumentHandlerDeleteDocumentIfMatchOther_short').show(); window.location.hash='RestDocumentHandlerDeleteDocumentIfMatchOther_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerDeleteDocumentIfMatchOther_short" onclick="$('#RestDocumentHandlerDeleteDocumentIfMatchOther_short').hide(); $('#RestDocumentHandlerDeleteDocumentIfMatchOther_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'If-Match: "_ZXF6W_u--C"'</span> --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69725</span>
HTTP/<span class="hljs-number">1.1</span> Precondition Failed
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6W_u--A"</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/patch_update_multiple_documents.md -->
@startDocuBlock patch_update_document_MULTI
@brief updates multiple documents
@RESTHEADER{PATCH /_api/document/{collection},Update documents,updateDocument }
@RESTALLBODYPARAM{documents,json,required}
A JSON representation of an array of document updates as objects.
@RESTURLPARAMETERS
@RESTURLPARAM{collection,string,required}
This URL parameter is the name of the collection in which the
documents are updated.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{keepNull,boolean,optional}
If the intention is to delete existing attributes with the patch
command, the URL query parameter *keepNull* can be used with a value
of *false*. This will modify the behavior of the patch command to
remove any attributes from the existing document that are contained
in the patch document with an attribute value of *null*.
@RESTQUERYPARAM{mergeObjects,boolean,optional}
Controls whether objects (not arrays) will be merged if present in
both the existing and the patch document. If set to *false*, the
value in the patch document will overwrite the existing document's
value. If set to *true*, objects will be merged. The default is
*true*.
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until the new documents have been synced to disk.
@RESTQUERYPARAM{ignoreRevs,boolean,optional}
By default, or if this is set to *true*, the *_rev* attributes in
the given documents are ignored. If this is set to *false*, then
any *_rev* attribute given in a body document is taken as a
precondition. The document is only updated if the current revision
is the one specified.
@RESTQUERYPARAM{returnOld,boolean,optional}
Return additionally the complete previous revision of the changed
documents under the attribute *old* in the result.
@RESTQUERYPARAM{returnNew,boolean,optional}
Return additionally the complete new documents under the attribute *new*
in the result.
@RESTDESCRIPTION
Partially updates documents, the documents to update are specified
by the *_key* attributes in the body objects. The body of the
request must contain a JSON array of document updates with the
attributes to patch (the patch documents). All attributes from the
patch documents will be added to the existing documents if they do
not yet exist, and overwritten in the existing documents if they do
exist there.
Setting an attribute value to *null* in the patch documents will cause a
value of *null* to be saved for the attribute by default.
If *ignoreRevs* is *false* and there is a *_rev* attribute in a
document in the body and its value does not match the revision of
the corresponding document in the database, the precondition is
violated.
If the document exists and can be updated, then an *HTTP 201* or
an *HTTP 202* is returned (depending on *waitForSync*, see below).
Optionally, the query parameter *waitForSync* can be used to force
synchronization of the document replacement operation to disk even in case
that the *waitForSync* flag had been disabled for the entire collection.
Thus, the *waitForSync* query parameter can be used to force synchronization
of just specific operations. To use this, set the *waitForSync* parameter
to *true*. If the *waitForSync* parameter is not specified or set to
*false*, then the collection's default *waitForSync* behavior is
applied. The *waitForSync* query parameter cannot be used to disable
synchronization for collections that have a default *waitForSync* value
of *true*.
The body of the response contains a JSON array of the same length
as the input array with the information about the handle and the
revision of the updated documents. In each entry, the attribute
*_id* contains the known *document-handle* of each updated document,
*_key* contains the key which uniquely identifies a document in a
given collection, and the attribute *_rev* contains the new document
revision. In case of an error or violated precondition, an error
object with the attribute *error* set to *true* and the attribute
*errorCode* set to the error code is built.
If the query parameter *returnOld* is *true*, then, for each
generated document, the complete previous revision of the document
is returned under the *old* attribute in the result.
If the query parameter *returnNew* is *true*, then, for each
generated document, the complete new document is returned under
the *new* attribute in the result.
Note that if any precondition is violated or an error occurred with
some of the documents, the return code is still 201 or 202, but
the additional HTTP header *X-Arango-Error-Codes* is set, which
contains a map of the error codes that occurred together with their
multiplicities, as in: *1200:17,1205:10* which means that in 17
cases the error 1200 "revision conflict" and in 10 cases the error
1205 "illegal document handle" has happened.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the documents were updated successfully and
*waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if the documents were updated successfully and
*waitForSync* was *false*.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation
of an array of documents. The response body contains
an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection was not found.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/patch_update_document.md -->
@startDocuBlock patch_update_document
@brief updates a document
@RESTHEADER{PATCH /_api/document/{document-handle},Update document, updateDocument}
@RESTALLBODYPARAM{document,json,required}
A JSON representation of a document update as an object.
@RESTURLPARAMETERS
@RESTURLPARAM{document-handle,string,required}
This URL parameter must be a document handle.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{keepNull,boolean,optional}
If the intention is to delete existing attributes with the patch
command, the URL query parameter *keepNull* can be used with a value
of *false*. This will modify the behavior of the patch command to
remove any attributes from the existing document that are contained
in the patch document with an attribute value of *null*.
@RESTQUERYPARAM{mergeObjects,boolean,optional}
Controls whether objects (not arrays) will be merged if present in
both the existing and the patch document. If set to *false*, the
value in the patch document will overwrite the existing document's
value. If set to *true*, objects will be merged. The default is
*true*.
@RESTQUERYPARAM{waitForSync,boolean,optional}
Wait until document has been synced to disk.
@RESTQUERYPARAM{ignoreRevs,boolean,optional}
By default, or if this is set to *true*, the *_rev* attributes in
the given document is ignored. If this is set to *false*, then
the *_rev* attribute given in the body document is taken as a
precondition. The document is only updated if the current revision
is the one specified.
@RESTQUERYPARAM{returnOld,boolean,optional}
Return additionally the complete previous revision of the changed
document under the attribute *old* in the result.
@RESTQUERYPARAM{returnNew,boolean,optional}
Return additionally the complete new document under the attribute *new*
in the result.
@RESTQUERYPARAM{silent,boolean,optional}
If set to *true*, an empty object will be returned as response. No meta-data
will be returned for the updated document. This option can be used to
save some network traffic.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{If-Match,string,optional}
You can conditionally update a document based on a target revision id by
using the *if-match* HTTP header.
@RESTDESCRIPTION
Partially updates the document identified by *document-handle*.
The body of the request must contain a JSON document with the
attributes to patch (the patch document). All attributes from the
patch document will be added to the existing document if they do not
yet exist, and overwritten in the existing document if they do exist
there.
Setting an attribute value to *null* in the patch document will cause a
value of *null* to be saved for the attribute by default.
If the *If-Match* header is specified and the revision of the
document in the database is unequal to the given revision, the
precondition is violated.
If *If-Match* is not given and *ignoreRevs* is *false* and there
is a *_rev* attribute in the body and its value does not match
the revision of the document in the database, the precondition is
violated.
If a precondition is violated, an *HTTP 412* is returned.
If the document exists and can be updated, then an *HTTP 201* or
an *HTTP 202* is returned (depending on *waitForSync*, see below),
the *Etag* header field contains the new revision of the document
(in double quotes) and the *Location* header contains a complete URL
under which the document can be queried.
Optionally, the query parameter *waitForSync* can be used to force
synchronization of the updated document operation to disk even in case
that the *waitForSync* flag had been disabled for the entire collection.
Thus, the *waitForSync* query parameter can be used to force synchronization
of just specific operations. To use this, set the *waitForSync* parameter
to *true*. If the *waitForSync* parameter is not specified or set to
*false*, then the collection's default *waitForSync* behavior is
applied. The *waitForSync* query parameter cannot be used to disable
synchronization for collections that have a default *waitForSync* value
of *true*.
If *silent* is not set to *true*, the body of the response contains a JSON
object with the information about the handle and the revision. The attribute
*_id* contains the known *document-handle* of the updated document, *_key*
contains the key which uniquely identifies a document in a given collection,
and the attribute *_rev* contains the new document revision.
If the query parameter *returnOld* is *true*, then
the complete previous revision of the document
is returned under the *old* attribute in the result.
If the query parameter *returnNew* is *true*, then
the complete new document is returned under
the *new* attribute in the result.
If the document does not exist, then a *HTTP 404* is returned and the
body of the response contains an error document.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the document was updated successfully and
*waitForSync* was *true*.
@RESTRETURNCODE{202}
is returned if the document was updated successfully and
*waitForSync* was *false*.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation
of a document. The response body contains
an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection or the document was not found.
@RESTRETURNCODE{412}
is returned if the precondition was violated. The response will
also contain the found documents' current revisions in the *_rev*
attributes. Additionally, the attributes *_id* and *_key* will be
returned.
@EXAMPLES
Patches an existing document with new content.
<div class="example-container" id="RestDocumentHandlerPatchDocument_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPatchDocument_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPatchDocument_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69781</span> &lt;&lt;EOF
{
<span class="hljs-string">"hello"</span> : <span class="hljs-string">"world"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDO--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69781</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69781"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69781"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDO--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6WDK--A"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69781</span> &lt;&lt;EOF
{
<span class="hljs-string">"numbers"</span> : {
<span class="hljs-string">"one"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"two"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"three"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-literal">null</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDS--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69781</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69781"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69781"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDS--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6WDO--_"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69781</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDS--_"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69781"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69781"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDS--_"</span>,
<span class="hljs-string">"one"</span> : <span class="hljs-string">"world"</span>,
<span class="hljs-string">"hello"</span> : <span class="hljs-string">"world"</span>,
<span class="hljs-string">"numbers"</span> : {
<span class="hljs-string">"one"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"two"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"three"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-literal">null</span>
}
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69781?keepNull=<span class="hljs-literal">false</span></span> &lt;&lt;EOF
{
<span class="hljs-string">"hello"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"numbers"</span> : {
<span class="hljs-string">"four"</span> : <span class="hljs-number">4</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDa--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69781</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69781"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69781"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDa--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6WDS--_"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69781</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDa--_"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69781"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69781"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDa--_"</span>,
<span class="hljs-string">"one"</span> : <span class="hljs-string">"world"</span>,
<span class="hljs-string">"numbers"</span> : {
<span class="hljs-string">"empty"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"one"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"three"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"two"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"four"</span> : <span class="hljs-number">4</span>
}
}
</pre>
<div id="RestDocumentHandlerPatchDocument_container_collapse" onclick="$('#RestDocumentHandlerPatchDocument_long').hide(); $('#RestDocumentHandlerPatchDocument_short').show(); window.location.hash='RestDocumentHandlerPatchDocument_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPatchDocument_short" onclick="$('#RestDocumentHandlerPatchDocument_short').hide(); $('#RestDocumentHandlerPatchDocument_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69781</span> &lt;&lt;EOF
{
<span class="hljs-string">"hello"</span> : <span class="hljs-string">"world"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDO--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69781</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69781</span> &lt;&lt;EOF
{
<span class="hljs-string">"numbers"</span> : {
<span class="hljs-string">"one"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"two"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"three"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"empty"</span> : <span class="hljs-literal">null</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDS--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69781</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69781</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDS--_"</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69781?keepNull=<span class="hljs-literal">false</span></span> &lt;&lt;EOF
{
<span class="hljs-string">"hello"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"numbers"</span> : {
<span class="hljs-string">"four"</span> : <span class="hljs-number">4</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDa--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69781</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69781</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDa--_"</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Merging attributes of an object using `mergeObjects`:
<div class="example-container" id="RestDocumentHandlerPatchDocumentMerge_container">
<a class="anchorjs-link " href="#RestDocumentHandlerPatchDocumentMerge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerPatchDocumentMerge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69795</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDu--A"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69795"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69795"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDu--A"</span>,
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"china"</span> : <span class="hljs-number">1366980000</span>,
<span class="hljs-string">"india"</span> : <span class="hljs-number">1263590000</span>,
<span class="hljs-string">"usa"</span> : <span class="hljs-number">319220000</span>
}
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69795?mergeObjects=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"indonesia"</span> : <span class="hljs-number">252164800</span>,
<span class="hljs-string">"brazil"</span> : <span class="hljs-number">203553000</span>
}
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69795</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDy--_"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69795"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69795"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WDy--_"</span>,
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"china"</span> : <span class="hljs-number">1366980000</span>,
<span class="hljs-string">"india"</span> : <span class="hljs-number">1263590000</span>,
<span class="hljs-string">"usa"</span> : <span class="hljs-number">319220000</span>,
<span class="hljs-string">"indonesia"</span> : <span class="hljs-number">252164800</span>,
<span class="hljs-string">"brazil"</span> : <span class="hljs-number">203553000</span>
}
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69795?mergeObjects=<span class="hljs-literal">false</span></span> &lt;&lt;EOF
{
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"pakistan"</span> : <span class="hljs-number">188346000</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WD6--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69795</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69795"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69795"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WD6--_"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF6WDy--_"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69795</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WD6--_"</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"69795"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/69795"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WD6--_"</span>,
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"pakistan"</span> : <span class="hljs-number">188346000</span>
}
}
</pre>
<div id="RestDocumentHandlerPatchDocumentMerge_container_collapse" onclick="$('#RestDocumentHandlerPatchDocumentMerge_long').hide(); $('#RestDocumentHandlerPatchDocumentMerge_short').show(); window.location.hash='RestDocumentHandlerPatchDocumentMerge_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerPatchDocumentMerge_short" onclick="$('#RestDocumentHandlerPatchDocumentMerge_short').hide(); $('#RestDocumentHandlerPatchDocumentMerge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69795</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDu--A"</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69795?mergeObjects=<span class="hljs-literal">true</span></span> &lt;&lt;EOF
{
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"indonesia"</span> : <span class="hljs-number">252164800</span>,
<span class="hljs-string">"brazil"</span> : <span class="hljs-number">203553000</span>
}
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69795</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WDy--_"</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/document/products/69795?mergeObjects=<span class="hljs-literal">false</span></span> &lt;&lt;EOF
{
<span class="hljs-string">"inhabitants"</span> : {
<span class="hljs-string">"pakistan"</span> : <span class="hljs-number">188346000</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WD6--_"</span>
location: <span class="hljs-regexp">/_db/</span>_system/_api/<span class="hljs-built_in">document</span>/products/<span class="hljs-number">69795</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69795</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: <span class="hljs-string">"_ZXF6WD6--_"</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/put_read_all_documents.md -->
@startDocuBlock put_read_all_documents
@brief reads all documents from collection
@RESTHEADER{PUT /_api/simple/all-keys, Read all documents, allDocumentKeys}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,optional}
The name of the collection.
**This parameter is only for an easier migration path from old versions.**
In ArangoDB versions < 3.0, the URL path was `/_api/document` and
this was passed in via the query parameter "collection".
This combination was removed. The collection name can be passed to
`/_api/simple/all-keys` as body parameter (preferred) or as query parameter.
@RESTBODYPARAM{collection,string,required,}
The collection that should be queried
@RESTBODYPARAM{type,string,optional,}
The type of the result. The following values are allowed:
- *id*: returns an array of document ids (*_id* attributes)
- *key*: returns an array of document keys (*_key* attributes)
- *path*: returns an array of document URI paths. This is the default.
@RESTDESCRIPTION
Returns an array of all keys, ids, or URI paths for all documents in the
collection identified by *collection*. The type of the result array is
determined by the *type* attribute.
Note that the results have no defined order and thus the order should
not be relied on.
Note: the *all-keys* simple query is **deprecated** as of ArangoDB 3.4.0.
This API may get removed in future versions of ArangoDB. You can use the
`/_api/cursor` endpoint instead with one of the below AQL queries depending
on the desired result:
- `FOR doc IN @@collection RETURN doc._id` to mimic *type: id*
- `FOR doc IN @@collection RETURN doc._key` to mimic *type: key*
- `FOR doc IN @@collection RETURN CONCAT("/_db/", CURRENT_DATABASE(), "/_api/document/", doc._id)`
to mimic *type: path*
@RESTRETURNCODES
@RESTRETURNCODE{201}
All went well.
@RESTRETURNCODE{404}
The collection does not exist.
@EXAMPLES
Return all document paths
<div class="example-container" id="RestDocumentHandlerReadDocumentAllPath_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentAllPath_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentAllPath_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
<span class="hljs-string">"/_db/_system/_api/document/products/69899"</span>,
<span class="hljs-string">"/_db/_system/_api/document/products/69901"</span>,
<span class="hljs-string">"/_db/_system/_api/document/products/69903"</span>
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0001697540283203125</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">34377</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestDocumentHandlerReadDocumentAllPath_container_collapse" onclick="$('#RestDocumentHandlerReadDocumentAllPath_long').hide(); $('#RestDocumentHandlerReadDocumentAllPath_short').show(); window.location.hash='RestDocumentHandlerReadDocumentAllPath_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerReadDocumentAllPath_short" onclick="$('#RestDocumentHandlerReadDocumentAllPath_short').hide(); $('#RestDocumentHandlerReadDocumentAllPath_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Return all document keys
<div class="example-container" id="RestDocumentHandlerReadDocumentAllKey_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentAllKey_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentAllKey_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"id"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
<span class="hljs-string">"products/69885"</span>,
<span class="hljs-string">"products/69887"</span>,
<span class="hljs-string">"products/69889"</span>
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0002968311309814453</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">34209</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestDocumentHandlerReadDocumentAllKey_container_collapse" onclick="$('#RestDocumentHandlerReadDocumentAllKey_long').hide(); $('#RestDocumentHandlerReadDocumentAllKey_short').show(); window.location.hash='RestDocumentHandlerReadDocumentAllKey_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerReadDocumentAllKey_short" onclick="$('#RestDocumentHandlerReadDocumentAllKey_short').hide(); $('#RestDocumentHandlerReadDocumentAllKey_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"id"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Collection does not exist
<div class="example-container" id="RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/doesnotexist</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"expecting GET /_api/document/&lt;document-handle&gt;"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_container_collapse" onclick="$('#RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_long').hide(); $('#RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_short').show(); window.location.hash='RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_short" onclick="$('#RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_short').hide(); $('#RestDocumentHandlerReadDocumentAllCollectionDoesNotExist_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/doesnotexist</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/head_read_document_header.md -->
@startDocuBlock head_read_document_header
@brief reads a single document head
@RESTHEADER{HEAD /_api/document/{document-handle},Read document header, checkDocument}
@RESTURLPARAMETERS
@RESTURLPARAM{document-handle,string,required}
The handle of the document.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{If-None-Match,string,optional}
If the "If-None-Match" header is given, then it must contain exactly one
Etag. If the current document revision is not equal to the specified Etag,
an *HTTP 200* response is returned. If the current document revision is
identical to the specified Etag, then an *HTTP 304* is returned.
@RESTHEADERPARAM{If-Match,string,optional}
If the "If-Match" header is given, then it must contain exactly one
Etag. The document is returned, if it has the same revision as the
given Etag. Otherwise a *HTTP 412* is returned.
@RESTDESCRIPTION
Like *GET*, but only returns the header fields and not the body. You
can use this call to get the current revision of a document or check if
the document was deleted.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the document was found
@RESTRETURNCODE{304}
is returned if the "If-None-Match" header is given and the document has
the same version
@RESTRETURNCODE{404}
is returned if the document or collection was not found
@RESTRETURNCODE{412}
is returned if an "If-Match" header is given and the found
document has a different version. The response will also contain the found
document's current revision in the *Etag* header.
@EXAMPLES
<div class="example-container" id="RestDocumentHandlerReadDocumentHead_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentHead_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentHead_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X HEAD --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69913</span>
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Documents/head_read_document_header.md -->
@startDocuBlock head_read_document_header
@brief reads a single document head
@RESTHEADER{HEAD /_api/document/{document-handle},Read document header, checkDocument}
@RESTURLPARAMETERS
@RESTURLPARAM{document-handle,string,required}
The handle of the document.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{If-None-Match,string,optional}
If the "If-None-Match" header is given, then it must contain exactly one
Etag. If the current document revision is not equal to the specified Etag,
an *HTTP 200* response is returned. If the current document revision is
identical to the specified Etag, then an *HTTP 304* is returned.
@RESTHEADERPARAM{If-Match,string,optional}
If the "If-Match" header is given, then it must contain exactly one
Etag. The document is returned, if it has the same revision as the
given Etag. Otherwise a *HTTP 412* is returned.
@RESTDESCRIPTION
Like *GET*, but only returns the header fields and not the body. You
can use this call to get the current revision of a document or check if
the document was deleted.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the document was found
@RESTRETURNCODE{304}
is returned if the "If-None-Match" header is given and the document has
the same version
@RESTRETURNCODE{404}
is returned if the document or collection was not found
@RESTRETURNCODE{412}
is returned if an "If-Match" header is given and the found
document has a different version. The response will also contain the found
document's current revision in the *Etag* header.
@EXAMPLES
<div class="example-container" id="RestDocumentHandlerReadDocumentHead_container">
<a class="anchorjs-link " href="#RestDocumentHandlerReadDocumentHead_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDocumentHandlerReadDocumentHead_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X HEAD --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/document/products/69913</span>
</pre>
</div>
</div>
@endDocuBlock
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_truncate.md -->
@startDocuBlock put_api_collection_truncate
@brief truncates a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/truncate, Truncate collection, handleCommandPut:truncateCollection}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
Removes all documents from the collection, but leaves the indexes intact.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
<div class="example-container" id="RestCollectionIdentifierTruncate_container">
<a class="anchorjs-link " href="#RestCollectionIdentifierTruncate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionIdentifierTruncate_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/truncate</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/truncate
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69434"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69434"</span>
}
</pre>
<div id="RestCollectionIdentifierTruncate_container_collapse" onclick="$('#RestCollectionIdentifierTruncate_long').hide(); $('#RestCollectionIdentifierTruncate_short').show(); window.location.hash='RestCollectionIdentifierTruncate_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionIdentifierTruncate_short" onclick="$('#RestCollectionIdentifierTruncate_short').hide(); $('#RestCollectionIdentifierTruncate_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/truncate</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/truncate
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_checksum.md -->
@startDocuBlock get_api_collection_checksum
@brief returns a checksum for the specified collection
@RESTHEADER{GET /_api/collection/{collection-name}/checksum, Return checksum for the collection, handleCommandGet:collectionChecksum}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{withRevisions,boolean,optional}
Whether or not to include document revision ids in the checksum calculation.
@RESTQUERYPARAM{withData,boolean,optional}
Whether or not to include document body data in the checksum calculation.
@RESTDESCRIPTION
Will calculate a checksum of the meta-data (keys and optionally revision ids) and
optionally the document data in the collection.
The checksum can be used to compare if two collections on different ArangoDB
instances contain the same contents. The current revision of the collection is
returned too so one can make sure the checksums are calculated for the same
state of data.
By default, the checksum will only be calculated on the *_key* system attribute
of the documents contained in the collection. For edge collections, the system
attributes *_from* and *_to* will also be included in the calculation.
By setting the optional query parameter *withRevisions* to *true*, then revision
ids (*_rev* system attributes) are included in the checksumming.
By providing the optional query parameter *withData* with a value of *true*,
the user-defined document attributes will be included in the calculation too.
**Note**: Including user-defined attributes will make the checksumming slower.
The response is a JSON object with the following attributes:
- *checksum*: The calculated checksum as a number.
- *revision*: The collection revision id as a string.
**Note**: this method is not available in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
Retrieving the checksum of a collection:
<div class="example-container" id="RestCollectionGetCollectionChecksum_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionChecksum_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionChecksum_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/checksum</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/checksum
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69139"</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69139"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"revision"</span> : <span class="hljs-string">"_ZXF6UMq--A"</span>,
<span class="hljs-string">"checksum"</span> : <span class="hljs-string">"7419273219675662334"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>
}
</pre>
<div id="RestCollectionGetCollectionChecksum_container_collapse" onclick="$('#RestCollectionGetCollectionChecksum_long').hide(); $('#RestCollectionGetCollectionChecksum_short').show(); window.location.hash='RestCollectionGetCollectionChecksum_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionChecksum_short" onclick="$('#RestCollectionGetCollectionChecksum_short').hide(); $('#RestCollectionGetCollectionChecksum_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/checksum</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/checksum
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Retrieving the checksum of a collection including the collection data,
but not the revisions:
<div class="example-container" id="RestCollectionGetCollectionChecksumNoRev_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionChecksumNoRev_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionChecksumNoRev_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/checksum?withRevisions=<span class="hljs-literal">false</span>&amp;withData=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/checksum
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69149"</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69149"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"revision"</span> : <span class="hljs-string">"_ZXF6UNC---"</span>,
<span class="hljs-string">"checksum"</span> : <span class="hljs-string">"6645407894587102697"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>
}
</pre>
<div id="RestCollectionGetCollectionChecksumNoRev_container_collapse" onclick="$('#RestCollectionGetCollectionChecksumNoRev_long').hide(); $('#RestCollectionGetCollectionChecksumNoRev_short').show(); window.location.hash='RestCollectionGetCollectionChecksumNoRev_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionChecksumNoRev_short" onclick="$('#RestCollectionGetCollectionChecksumNoRev_short').hide(); $('#RestCollectionGetCollectionChecksumNoRev_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/checksum?withRevisions=<span class="hljs-literal">false</span>&amp;withData=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/checksum
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_properties.md -->
@startDocuBlock get_api_collection_properties
@brief reads the properties of the specified collection
@RESTHEADER{GET /_api/collection/{collection-name}/properties, Read properties of a collection, handleCommandGet:collectionProperties}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@RESTRETURNCODE{200}
@RESTREPLYBODY{,object,required,collection_info}
@RESTDESCRIPTION
@EXAMPLES
Using an identifier:
<div class="example-container" id="RestCollectionGetCollectionIdentifier_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionIdentifier_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionIdentifier_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/69377/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/<span class="hljs-number">69377</span>/properties
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69377"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69376"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69377"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>
}
</pre>
<div id="RestCollectionGetCollectionIdentifier_container_collapse" onclick="$('#RestCollectionGetCollectionIdentifier_long').hide(); $('#RestCollectionGetCollectionIdentifier_short').show(); window.location.hash='RestCollectionGetCollectionIdentifier_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionIdentifier_short" onclick="$('#RestCollectionGetCollectionIdentifier_short').hide(); $('#RestCollectionGetCollectionIdentifier_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/69377/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/<span class="hljs-number">69377</span>/properties
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a name:
<div class="example-container" id="RestCollectionGetCollectionName_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionName_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/properties
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69385"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69384"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69385"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>
}
</pre>
<div id="RestCollectionGetCollectionName_container_collapse" onclick="$('#RestCollectionGetCollectionName_long').hide(); $('#RestCollectionGetCollectionName_short').show(); window.location.hash='RestCollectionGetCollectionName_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionName_short" onclick="$('#RestCollectionGetCollectionName_short').hide(); $('#RestCollectionGetCollectionName_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/properties
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_name.md -->
@startDocuBlock get_api_collection_name
@brief returns a collection
@RESTHEADER{GET /_api/collection/{collection-name}, Return information about a collection, handleCommandGet:collectionGetProperties}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
The result is an object describing the collection with the following
attributes:
- *id*: The identifier of the collection.
- *name*: The name of the collection.
- *status*: The status of the collection as number.
- 1: new born collection
- 2: unloaded
- 3: loaded
- 4: in the process of being unloaded
- 5: deleted
- 6: loading
Every other status indicates a corrupted collection.
- *type*: The type of the collection as number.
- 2: document collection (normal case)
- 3: edges collection
- *isSystem*: If *true* then the collection is a system collection.
@RESTRETURNCODES
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is
returned.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_load.md -->
@startDocuBlock put_api_collection_load
@brief loads a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/load, Load collection, handleCommandPut:loadCollection}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
Loads a collection into memory. Returns the collection on success.
The request body object might optionally contain the following attribute:
- *count*: If set, this controls whether the return value should include
the number of documents in the collection. Setting *count* to
*false* may speed up loading a collection. The default value for
*count* is *true*.
On success an object with the following attributes is returned:
- *id*: The identifier of the collection.
- *name*: The name of the collection.
- *count*: The number of documents inside the collection. This is only
returned if the *count* input parameters is set to *true* or has
not been specified.
- *status*: The status of the collection as number.
- *type*: The collection type. Valid types are:
- 2: document collection
- 3: edges collection
- *isSystem*: If *true* then the collection is a system collection.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
<div class="example-container" id="RestCollectionIdentifierLoad_container">
<a class="anchorjs-link " href="#RestCollectionIdentifierLoad_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionIdentifierLoad_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/load</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/load
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69401"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69401"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>
}
</pre>
<div id="RestCollectionIdentifierLoad_container_collapse" onclick="$('#RestCollectionIdentifierLoad_long').hide(); $('#RestCollectionIdentifierLoad_short').show(); window.location.hash='RestCollectionIdentifierLoad_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionIdentifierLoad_short" onclick="$('#RestCollectionIdentifierLoad_short').hide(); $('#RestCollectionIdentifierLoad_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/load</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/load
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_recalculate_count.md -->
@startDocuBlock put_api_collection_recalculate_count
@brief recalculates the document count of a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/recalculateCount, Recalculate count of a collection, handleCommandPut:recalculateCount}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
Recalculates the document count of a collection, if it ever becomes inconsistent.
It returns an object with the attributes
- *result*: will be *true* if recalculating the document count succeeded.
**Note**: this method is specific for the RocksDB storage engine
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the document count was recalculated successfully, *HTTP 200* is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/delete_api_collection.md -->
@startDocuBlock delete_api_collection
@brief drops a collection
@RESTHEADER{DELETE /_api/collection/{collection-name}, Drops a collection, handleCommandDelete:collection}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection to drop.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{isSystem,boolean,optional}
Whether or not the collection to drop is a system collection. This parameter
must be set to *true* in order to drop a system collection.
@RESTDESCRIPTION
Drops the collection identified by *collection-name*.
If the collection was successfully dropped, an object is returned with
the following attributes:
- *error*: *false*
- *id*: The identifier of the dropped collection.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Using an identifier:
<div class="example-container" id="RestCollectionDeleteCollectionIdentifier_container">
<a class="anchorjs-link " href="#RestCollectionDeleteCollectionIdentifier_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionDeleteCollectionIdentifier_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/69118</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69118"</span>
}
</pre>
<div id="RestCollectionDeleteCollectionIdentifier_container_collapse" onclick="$('#RestCollectionDeleteCollectionIdentifier_long').hide(); $('#RestCollectionDeleteCollectionIdentifier_short').show(); window.location.hash='RestCollectionDeleteCollectionIdentifier_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionDeleteCollectionIdentifier_short" onclick="$('#RestCollectionDeleteCollectionIdentifier_short').hide(); $('#RestCollectionDeleteCollectionIdentifier_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/69118</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a name:
<div class="example-container" id="RestCollectionDeleteCollectionName_container">
<a class="anchorjs-link " href="#RestCollectionDeleteCollectionName_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionDeleteCollectionName_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products1</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69125"</span>
}
</pre>
<div id="RestCollectionDeleteCollectionName_container_collapse" onclick="$('#RestCollectionDeleteCollectionName_long').hide(); $('#RestCollectionDeleteCollectionName_short').show(); window.location.hash='RestCollectionDeleteCollectionName_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionDeleteCollectionName_short" onclick="$('#RestCollectionDeleteCollectionName_short').hide(); $('#RestCollectionDeleteCollectionName_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products1</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Dropping a system collection
<div class="example-container" id="RestCollectionDeleteCollectionSystem_container">
<a class="anchorjs-link " href="#RestCollectionDeleteCollectionSystem_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionDeleteCollectionSystem_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/_example?isSystem=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69132"</span>
}
</pre>
<div id="RestCollectionDeleteCollectionSystem_container_collapse" onclick="$('#RestCollectionDeleteCollectionSystem_long').hide(); $('#RestCollectionDeleteCollectionSystem_short').show(); window.location.hash='RestCollectionDeleteCollectionSystem_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionDeleteCollectionSystem_short" onclick="$('#RestCollectionDeleteCollectionSystem_short').hide(); $('#RestCollectionDeleteCollectionSystem_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/_example?isSystem=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_getResponsibleShard.md -->
@startDocuBlock get_api_collection_getResponsibleShard
@brief Return the responsible shard for a document
@RESTHEADER{PUT /_api/collection/{collection-name}/responsibleShard, Return responsible shard for a document, getResponsibleShard:Collection}
@RESTALLBODYPARAM{document,json,required}
The body must consist of a JSON object with at least the shard key
attributes set to some values.
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
Returns the ID of the shard that is responsible for the given document
(if the document exists) or that would be responsible if such document
existed.
The request must body must contain a JSON document with at least the
collection's shard key attributes set to some values.
The response is a JSON object with a *shardId* attribute, which will
contain the ID of the responsible shard.
**Note** : This method is only available in a cluster coordinator.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returns the ID of the responsible shard.
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
Additionally, if not all of the collection's shard key
attributes are present in the input document, then a
*HTTP 400* is returned as well.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then an *HTTP 404*
is returned.
@RESTRETURNCODE{501}
*HTTP 501* is returned if the method is called on a single server.
@EXAMPLES
<div class="example-container" id="RestGetResponsibleShardExample_cluster_container">
<a class="anchorjs-link " href="#RestGetResponsibleShardExample_cluster_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGetResponsibleShardExample_cluster_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/testCollection/responsibleShard</span> &lt;&lt;EOF
{"_key":"testkey","value":23}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/testCollection/responsibleShard
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"shardId"</span> : <span class="hljs-string">"s4010046"</span>
}
</pre>
<div id="RestGetResponsibleShardExample_cluster_container_collapse" onclick="$('#RestGetResponsibleShardExample_cluster_long').hide(); $('#RestGetResponsibleShardExample_cluster_short').show(); window.location.hash='RestGetResponsibleShardExample_cluster_container';" class="example_show_button">Hide response body</div></div>
<div id="RestGetResponsibleShardExample_cluster_short" onclick="$('#RestGetResponsibleShardExample_cluster_short').hide(); $('#RestGetResponsibleShardExample_cluster_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/testCollection/responsibleShard</span> &lt;&lt;EOF
{"_key":"testkey","value":23}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/testCollection/responsibleShard
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_rotate.md -->
@startDocuBlock put_api_collection_rotate
@brief rotates the journal of a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/rotate, Rotate journal of a collection, handleCommandPut:collectionRotate}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
Rotates the journal of a collection. The current journal of the collection will be closed
and made a read-only datafile. The purpose of the rotate method is to make the data in
the file available for compaction (compaction is only performed for read-only datafiles, and
not for journals).
Saving new data in the collection subsequently will create a new journal file
automatically if there is no current journal.
It returns an object with the attributes
- *result*: will be *true* if rotation succeeded
**Note**: this method is specific for the MMFiles storage engine, and there
it is not available in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the collection currently has no journal, *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Rotating the journal:
<div class="example-container" id="RestCollectionRotate_mmfiles_container">
<a class="anchorjs-link " href="#RestCollectionRotate_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionRotate_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products/rotate</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/rotate
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestCollectionRotate_mmfiles_container_collapse" onclick="$('#RestCollectionRotate_mmfiles_long').hide(); $('#RestCollectionRotate_mmfiles_short').show(); window.location.hash='RestCollectionRotate_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionRotate_mmfiles_short" onclick="$('#RestCollectionRotate_mmfiles_short').hide(); $('#RestCollectionRotate_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products/rotate</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/rotate
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Rotating if no journal exists:
<div class="example-container" id="RestCollectionRotateNoJournal_mmfiles_container">
<a class="anchorjs-link " href="#RestCollectionRotateNoJournal_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionRotateNoJournal_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products/rotate</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"no journal"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1105</span>
}
</pre>
<div id="RestCollectionRotateNoJournal_mmfiles_container_collapse" onclick="$('#RestCollectionRotateNoJournal_mmfiles_long').hide(); $('#RestCollectionRotateNoJournal_mmfiles_short').show(); window.location.hash='RestCollectionRotateNoJournal_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionRotateNoJournal_mmfiles_short" onclick="$('#RestCollectionRotateNoJournal_mmfiles_short').hide(); $('#RestCollectionRotateNoJournal_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products/rotate</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_revision.md -->
@startDocuBlock get_api_collection_revision
@brief Retrieve the collections revision id
@RESTHEADER{GET /_api/collection/{collection-name}/revision, Return collection revision id, handleCommandGet:collectionRevision}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
In addition to the above, the result will also contain the
collection's revision id. The revision id is a server-generated
string that clients can use to check whether data in a collection
has changed since the last revision check.
- *revision*: The collection revision id as a string.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
Retrieving the revision of a collection
<div class="example-container" id="RestCollectionGetCollectionRevision_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionRevision_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionRevision_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/revision</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/revision
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69393"</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69393"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"revision"</span> : <span class="hljs-string">"0"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69392"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="RestCollectionGetCollectionRevision_container_collapse" onclick="$('#RestCollectionGetCollectionRevision_long').hide(); $('#RestCollectionGetCollectionRevision_short').show(); window.location.hash='RestCollectionGetCollectionRevision_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionRevision_short" onclick="$('#RestCollectionGetCollectionRevision_short').hide(); $('#RestCollectionGetCollectionRevision_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/revision</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/revision
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_count.md -->
@startDocuBlock get_api_collection_count
@brief Counts the documents in a collection
@RESTHEADER{GET /_api/collection/{collection-name}/count, Return number of documents in a collection, handleCommandGet:getCollectionCount}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
In addition to the above, the result also contains the number of documents.
**Note** that this will always load the collection into memory.
- *count*: The number of documents inside the collection.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
Requesting the number of documents:
<div class="example-container" id="RestCollectionGetCollectionCount_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionCount_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionCount_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/count</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/count
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69158"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69159"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69159"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">69362</span>
}
}
</pre>
<div id="RestCollectionGetCollectionCount_container_collapse" onclick="$('#RestCollectionGetCollectionCount_long').hide(); $('#RestCollectionGetCollectionCount_short').show(); window.location.hash='RestCollectionGetCollectionCount_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionCount_short" onclick="$('#RestCollectionGetCollectionCount_short').hide(); $('#RestCollectionGetCollectionCount_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/count</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/count
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collections.md -->
@startDocuBlock get_api_collections
@brief returns all collections
@RESTHEADER{GET /_api/collection,reads all collections, handleCommandGet}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{excludeSystem,boolean,optional}
Whether or not system collections should be excluded from the result.
@RESTDESCRIPTION
Returns an object with an attribute *collections* containing an
array of all collection descriptions. The same information is also
available in the *names* as an object with the collection names
as keys.
By providing the optional query parameter *excludeSystem* with a value of
*true*, all system collections will be excluded from the response.
@RESTRETURNCODES
@RESTRETURNCODE{200}
The list of collections
@EXAMPLES
Return information about all collections:
<div class="example-container" id="RestCollectionGetAllCollections_container">
<a class="anchorjs-link " href="#RestCollectionGetAllCollections_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetAllCollections_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_statisticsRaw"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_statisticsRaw"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"13"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_statistics15"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_statistics15"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"10"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_statistics"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_statistics"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"7"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_graphs"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_graphs"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"4"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_users"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"19"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_analyzers"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_analyzers"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_aqlfunctions"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_aqlfunctions"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"25"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_queues"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_queues"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"31"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_apps"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_apps"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"108"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"animals"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/108"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"34"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_appbundles"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_appbundles"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_jobs"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_jobs"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"102"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"demo"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/102"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"37"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_frontend"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_frontend"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"40"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_modules"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_modules"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"43"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_fishbowl"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_fishbowl"</span>
}
]
}
</pre>
<div id="RestCollectionGetAllCollections_container_collapse" onclick="$('#RestCollectionGetAllCollections_long').hide(); $('#RestCollectionGetAllCollections_short').show(); window.location.hash='RestCollectionGetAllCollections_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetAllCollections_short" onclick="$('#RestCollectionGetAllCollections_short').hide(); $('#RestCollectionGetAllCollections_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_shards.md -->
@startDocuBlock get_api_collection_shards
@brief Return the shard ids of a collection
@RESTHEADER{GET /_api/collection/{collection-name}/shards, Return the shard ids of a collection, shards:Collection}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{details,boolean,optional}
If set to true, the return value will also contain the responsible servers for the collections' shards.
@RESTDESCRIPTION
By default returns a JSON array with the shard IDs of the collection.
If the `details` parameter is set to `true`, it will return a JSON object with the
shard IDs as object attribute keys, and the responsible servers for each shard mapped to them.
In the detailed response, the leader shards will be first in the arrays.
**Note** : This method is only available in a cluster coordinator.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returns the collection's shards.
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then an *HTTP 404*
is returned.
@RESTRETURNCODE{501}
*HTTP 501* is returned if the method is called on a single server.
@EXAMPLES
Retrieves the list of shards:
<div class="example-container" id="RestGetShards_cluster_container">
<a class="anchorjs-link " href="#RestGetShards_cluster_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGetShards_cluster_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/testCollection/shards</span>
HTTP/1.1 OK
content-type: application/json; charset=utf-8
location: /_api/collection/testCollection/shards
x-content-type-options: nosniff
"{\"error\":false,\"code\":200,\"cacheEnabled\":false,\"waitForSync\":false,\"status\":3,\"isSmart\":false,\"globallyUniqueId\":\"c4010051/\",\"keyOptions\":{\"allowUserKeys\":true,\"type\":\"traditional\"},\"type\":2,\"shardingStrategy\":\"hash\",\"shards\":[\"s4010052\",\"s4010053\",\"s4010054\"],\"name\":\"testCollection\",\"isSystem\":false,\"minReplicationFactor\":1,\"statusString\":\"loaded\",\"numberOfShards\":3,\"id\":\"4010051\",\"replicationFactor\":1,\"shardKeys\":[\"_key\"]}"
</pre>
</div>
</div>
Retrieves the list of shards with the responsible servers:
<div class="example-container" id="RestGetShardsWithDetails_cluster_container">
<a class="anchorjs-link " href="#RestGetShardsWithDetails_cluster_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGetShardsWithDetails_cluster_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/testCollection/shards?details=<span class="hljs-literal">true</span></span>
HTTP/1.1 OK
content-type: application/json; charset=utf-8
location: /_api/collection/testCollection/shards
x-content-type-options: nosniff
"{\"error\":false,\"code\":200,\"cacheEnabled\":false,\"waitForSync\":false,\"status\":3,\"isSmart\":false,\"globallyUniqueId\":\"c4010047/\",\"keyOptions\":{\"allowUserKeys\":true,\"type\":\"traditional\"},\"type\":2,\"shardingStrategy\":\"hash\",\"shards\":{\"s4010048\":[\"PRMR-7a02da4f-10ef-4c5e-b6e7-3d3b44aa43d1\"],\"s4010049\":[\"PRMR-e5836840-cc4d-443d-a612-0fa88c671a18\"],\"s4010050\":[\"PRMR-7a02da4f-10ef-4c5e-b6e7-3d3b44aa43d1\"]},\"name\":\"testCollection\",\"isSystem\":false,\"minReplicationFactor\":1,\"statusString\":\"loaded\",\"numberOfShards\":3,\"id\":\"4010047\",\"replicationFactor\":1,\"shardKeys\":[\"_key\"]}"
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/get_api_collection_figures.md -->
@startDocuBlock get_api_collection_figures
@brief Fetch the statistics of a collection
@RESTHEADER{GET /_api/collection/{collection-name}/figures, Return statistics for a collection, handleCommandGet:collectionFigures}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
In addition to the above, the result also contains the number of documents
and additional statistical information about the collection.
**Note**: This will always load the collection into memory.
**Note**: collection data that is stored in the write-ahead log only is
not reported in the results. When the write-ahead log is collected, documents
might be added to journals and datafiles of the collection, which may modify
the figures of the collection.
Additionally, the filesizes of collection and index parameter JSON files are
not reported. These files should normally have a size of a few bytes
each. Please also note that the *fileSize* values are reported in bytes
and reflect the logical file sizes. Some filesystems may use optimizations
(e.g. sparse files) so that the actual physical file size is somewhat
different. Directories and sub-directories may also require space in the
file system, but this space is not reported in the *fileSize* results.
That means that the figures reported do not reflect the actual disk
usage of the collection with 100% accuracy. The actual disk usage of
a collection is normally slightly higher than the sum of the reported
*fileSize* values. Still the sum of the *fileSize* values can still be
used as a lower bound approximation of the disk usage.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returns information about the collection:
@RESTREPLYBODY{count,integer,required,int64}
The number of documents currently present in the collection.
@RESTREPLYBODY{figures,object,required,collection_figures}
metrics of the collection
@RESTSTRUCT{alive,collection_figures,object,required,collection_figures_alive}
the currently active figures
@RESTSTRUCT{count,collection_figures_alive,integer,required,int64}
The number of currently active documents in all datafiles
and journals of the collection. Documents that are contained in the
write-ahead log only are not reported in this figure.
@RESTSTRUCT{size,collection_figures_alive,integer,required,int64}
The total size in bytes used by all active documents of
the collection. Documents that are contained in the write-ahead log only are
not reported in this figure.
@RESTSTRUCT{dead,collection_figures,object,required,collection_figures_dead}
the items waiting to be swept away by the cleaner
@RESTSTRUCT{count,collection_figures_dead,integer,required,int64}
The number of dead documents. This includes document
versions that have been deleted or replaced by a newer version. Documents
deleted or replaced that are contained the write-ahead log only are not reported
in this figure.
@RESTSTRUCT{size,collection_figures_dead,integer,required,int64}
The total size in bytes used by all dead documents.
@RESTSTRUCT{deletion,collection_figures_dead,integer,required,int64}
The total number of deletion markers. Deletion markers
only contained in the write-ahead log are not reporting in this figure.
@RESTSTRUCT{datafiles,collection_figures,object,required,collection_figures_datafiles}
Metrics regarding the datafiles
@RESTSTRUCT{count,collection_figures_datafiles,integer,required,int64}
The number of datafiles.
@RESTSTRUCT{fileSize,collection_figures_datafiles,integer,required,int64}
The total filesize of datafiles (in bytes).
@RESTSTRUCT{journals,collection_figures,object,required,collection_figures_journals}
Metrics regarding the journal files
@RESTSTRUCT{count,collection_figures_journals,integer,required,int64}
The number of journal files.
@RESTSTRUCT{fileSize,collection_figures_journals,integer,required,int64}
The total filesize of all journal files (in bytes).
@RESTSTRUCT{compactors,collection_figures,object,required,collection_figures_compactors}
@RESTSTRUCT{count,collection_figures_compactors,integer,required,int64}
The number of compactor files.
@RESTSTRUCT{fileSize,collection_figures_compactors,integer,required,int64}
The total filesize of all compactor files (in bytes).
@RESTSTRUCT{readcache,collection_figures,object,required,collection_figures_readcache}
@RESTSTRUCT{count,collection_figures_readcache,integer,required,int64}
The number of revisions of this collection stored in the document revisions cache.
@RESTSTRUCT{size,collection_figures_readcache,integer,required,int64}
The memory used for storing the revisions of this collection in the document
revisions cache (in bytes). This figure does not include the document data but
only mappings from document revision ids to cache entry locations.
@RESTSTRUCT{revisions,collection_figures,object,required,collection_figures_revisions}
@RESTSTRUCT{count,collection_figures_revisions,integer,required,int64}
The number of revisions of this collection managed by the storage engine.
@RESTSTRUCT{size,collection_figures_revisions,integer,required,int64}
The memory used for storing the revisions of this collection in the storage
engine (in bytes). This figure does not include the document data but only mappings
from document revision ids to storage engine datafile positions.
@RESTSTRUCT{indexes,collection_figures,object,required,collection_figures_indexes}
@RESTSTRUCT{count,collection_figures_indexes,integer,required,int64}
The total number of indexes defined for the collection, including the pre-defined
indexes (e.g. primary index).
@RESTSTRUCT{size,collection_figures_indexes,integer,required,int64}
The total memory allocated for indexes in bytes.
@RESTSTRUCT{lastTick,collection_figures,integer,required,int64}
The tick of the last marker that was stored in a journal
of the collection. This might be 0 if the collection does not yet have
a journal.
@RESTSTRUCT{uncollectedLogfileEntries,collection_figures,integer,required,int64}
The number of markers in the write-ahead
log for this collection that have not been transferred to journals or datafiles.
@RESTSTRUCT{documentReferences,collection_figures,integer,optional,int64}
The number of references to documents in datafiles that JavaScript code
currently holds. This information can be used for debugging compaction and
unload issues.
@RESTSTRUCT{waitingFor,collection_figures,string,optional,string}
An optional string value that contains information about which object type is at the
head of the collection's cleanup queue. This information can be used for debugging
compaction and unload issues.
@RESTSTRUCT{compactionStatus,collection_figures,object,optional,compactionStatus_attributes}
@RESTSTRUCT{message,compactionStatus_attributes,string,optional,string}
The action that was performed when the compaction was last run for the collection.
This information can be used for debugging compaction issues.
@RESTSTRUCT{time,compactionStatus_attributes,string,optional,string}
The point in time the compaction for the collection was last executed.
This information can be used for debugging compaction issues.
@RESTREPLYBODY{journalSize,integer,required,int64}
The maximal size of a journal or datafile in bytes.
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
Using an identifier and requesting the figures of the collection (MMFiles storage engine):
<div class="example-container" id="RestCollectionGetCollectionFigures_mmfiles_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionFigures_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionFigures_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/figures</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/figures
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"figures"</span> : {
<span class="hljs-string">"indexes"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">32128</span>
},
<span class="hljs-string">"documentReferences"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"waitingFor"</span> : <span class="hljs-string">"-"</span>,
<span class="hljs-string">"alive"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">80</span>
},
<span class="hljs-string">"dead"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deletion"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"compactionStatus"</span> : {
<span class="hljs-string">"message"</span> : <span class="hljs-string">"skipped compaction because collection has no datafiles"</span>,
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:17:20Z"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filesCombined"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"bytesRead"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"bytesWritten"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"datafiles"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"fileSize"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"journals"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"fileSize"</span> : <span class="hljs-number">33554432</span>
},
<span class="hljs-string">"compactors"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"fileSize"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"revisions"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">48192</span>
},
<span class="hljs-string">"lastTick"</span> : <span class="hljs-number">131</span>,
<span class="hljs-string">"uncollectedLogfileEntries"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">129</span>
},
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/122"</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"122"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>
}
</pre>
<div id="RestCollectionGetCollectionFigures_mmfiles_container_collapse" onclick="$('#RestCollectionGetCollectionFigures_mmfiles_long').hide(); $('#RestCollectionGetCollectionFigures_mmfiles_short').show(); window.location.hash='RestCollectionGetCollectionFigures_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionFigures_mmfiles_short" onclick="$('#RestCollectionGetCollectionFigures_mmfiles_short').hide(); $('#RestCollectionGetCollectionFigures_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/figures</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/figures
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using an identifier and requesting the figures of the collection (RocksDB storage engine):
<div class="example-container" id="RestCollectionGetCollectionFigures_rocksdb_container">
<a class="anchorjs-link " href="#RestCollectionGetCollectionFigures_rocksdb_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionGetCollectionFigures_rocksdb_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/figures</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/figures
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69366"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"figures"</span> : {
<span class="hljs-string">"indexes"</span> : {
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"size"</span> : <span class="hljs-number">124</span>
},
<span class="hljs-string">"documentsSize"</span> : <span class="hljs-number">756</span>,
<span class="hljs-string">"cacheInUse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"cacheSize"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"cacheUsage"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">69372</span>
},
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69367"</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69367"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>
}
</pre>
<div id="RestCollectionGetCollectionFigures_rocksdb_container_collapse" onclick="$('#RestCollectionGetCollectionFigures_rocksdb_long').hide(); $('#RestCollectionGetCollectionFigures_rocksdb_short').show(); window.location.hash='RestCollectionGetCollectionFigures_rocksdb_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionGetCollectionFigures_rocksdb_short" onclick="$('#RestCollectionGetCollectionFigures_rocksdb_short').hide(); $('#RestCollectionGetCollectionFigures_rocksdb_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/figures</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/figures
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md -->
@startDocuBlock put_api_collection_properties
@brief changes a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/properties, Change properties of a collection, handleCommandPut:modifyProperties}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection.
@RESTDESCRIPTION
Changes the properties of a collection. Expects an object with the
attribute(s)
- *waitForSync*: If *true* then creating or changing a
document will wait until the data has been synchronized to disk.
- *journalSize*: The maximal size of a journal or datafile in bytes.
The value must be at least `1048576` (1 MB). Note that when
changing the journalSize value, it will only have an effect for
additional journals or datafiles that are created. Already
existing journals or datafiles will not be affected.
On success an object with the following attributes is returned:
- *id*: The identifier of the collection.
- *name*: The name of the collection.
- *waitForSync*: The new value.
- *journalSize*: The new value.
- *status*: The status of the collection as number.
- *type*: The collection type. Valid types are:
- 2: document collection
- 3: edges collection
- *isSystem*: If *true* then the collection is a system collection.
- *isVolatile*: If *true* then the collection data will be
kept in memory only and ArangoDB will not write or sync the data
to disk.
- *doCompact*: Whether or not the collection will be compacted.
- *keyOptions*: JSON object which contains key generation options:
- *type*: specifies the type of the key generator. The currently
available generators are *traditional*, *autoincrement*, *uuid*
and *padded*.
- *allowUserKeys*: if set to *true*, then it is allowed to supply
own key values in the *_key* attribute of a document. If set to
*false*, then the key generator is solely responsible for
generating keys and supplying own key values in the *_key* attribute
of documents is considered an error.
**Note**: except for *waitForSync*, *journalSize* and *name*, collection
properties **cannot be changed** once a collection is created. To rename
a collection, the rename endpoint must be used.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
<div class="example-container" id="RestCollectionIdentifierPropertiesSync_container">
<a class="anchorjs-link " href="#RestCollectionIdentifierPropertiesSync_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionIdentifierPropertiesSync_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/properties
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69418"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69417"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69418"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>
}
</pre>
<div id="RestCollectionIdentifierPropertiesSync_container_collapse" onclick="$('#RestCollectionIdentifierPropertiesSync_long').hide(); $('#RestCollectionIdentifierPropertiesSync_short').show(); window.location.hash='RestCollectionIdentifierPropertiesSync_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionIdentifierPropertiesSync_short" onclick="$('#RestCollectionIdentifierPropertiesSync_short').hide(); $('#RestCollectionIdentifierPropertiesSync_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/properties
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_rename.md -->
@startDocuBlock put_api_collection_rename
@brief renames a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/rename, Rename collection, handleCommandPut:renameCollection}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
The name of the collection to rename.
@RESTDESCRIPTION
Renames a collection. Expects an object with the attribute(s)
- *name*: The new name.
It returns an object with the attributes
- *id*: The identifier of the collection.
- *name*: The new name of the collection.
- *status*: The status of the collection as number.
- *type*: The collection type. Valid types are:
- 2: document collection
- 3: edges collection
- *isSystem*: If *true* then the collection is a system collection.
If renaming the collection succeeds, then the collection is also renamed in
all graph definitions inside the `_graphs` collection in the current database.
**Note**: this method is not available in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404*
is returned.
@EXAMPLES
<div class="example-container" id="RestCollectionIdentifierRename_container">
<a class="anchorjs-link " href="#RestCollectionIdentifierRename_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionIdentifierRename_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products1/rename</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"newname"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products1/rename
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"newname"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69427"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69427"</span>
}
</pre>
<div id="RestCollectionIdentifierRename_container_collapse" onclick="$('#RestCollectionIdentifierRename_long').hide(); $('#RestCollectionIdentifierRename_short').show(); window.location.hash='RestCollectionIdentifierRename_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionIdentifierRename_short" onclick="$('#RestCollectionIdentifierRename_short').hide(); $('#RestCollectionIdentifierRename_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection/products1/rename</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"newname"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products1/rename
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_unload.md -->
@startDocuBlock put_api_collection_unload
@brief unloads a collection
@RESTHEADER{PUT /_api/collection/{collection-name}/unload, Unload collection, handleCommandPut:collectionUnload}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
@RESTDESCRIPTION
Removes a collection from memory. This call does not delete any documents.
You can use the collection afterwards; in which case it will be loaded into
memory, again. On success an object with the following attributes is
returned:
- *id*: The identifier of the collection.
- *name*: The name of the collection.
- *status*: The status of the collection as number.
- *type*: The collection type. Valid types are:
- 2: document collection
- 3: edges collection
- *isSystem*: If *true* then the collection is a system collection.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
<div class="example-container" id="RestCollectionIdentifierUnload_container">
<a class="anchorjs-link " href="#RestCollectionIdentifierUnload_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionIdentifierUnload_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/unload</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/unload
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69442"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69442"</span>
}
</pre>
<div id="RestCollectionIdentifierUnload_container_collapse" onclick="$('#RestCollectionIdentifierUnload_long').hide(); $('#RestCollectionIdentifierUnload_short').show(); window.location.hash='RestCollectionIdentifierUnload_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionIdentifierUnload_short" onclick="$('#RestCollectionIdentifierUnload_short').hide(); $('#RestCollectionIdentifierUnload_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/unload</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/unload
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/put_api_collection_load_indexes_in_memory.md -->
@startDocuBlock put_api_collection_load_indexes_into_memory
@brief Load Indexes into Memory
@RESTHEADER{PUT /_api/collection/{collection-name}/loadIndexesIntoMemory, Load Indexes into Memory, handleCommandPut:loadIndexes}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-name,string,required}
@RESTDESCRIPTION
This route tries to cache all index entries
of this collection into the main memory.
Therefore it iterates over all indexes of the collection
and stores the indexed values, not the entire document data,
in memory.
All lookups that could be found in the cache are much faster
than lookups not stored in the cache so you get a nice performance boost.
It is also guaranteed that the cache is consistent with the stored data.
For the time being this function is only useful on RocksDB storage engine,
as in MMFiles engine all indexes are in memory anyways.
On RocksDB this function honors all memory limits, if the indexes you want
to load are smaller than your memory limit this function guarantees that most
index values are cached.
If the index is larger than your memory limit this function will fill up values
up to this limit and for the time being there is no way to control which indexes
of the collection should have priority over others.
On sucess this function returns an object with attribute `result` set to `true`
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the indexes have all been loaded
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
<div class="example-container" id="RestCollectionIdentifierLoadIndexesIntoMemory_container">
<a class="anchorjs-link " href="#RestCollectionIdentifierLoadIndexesIntoMemory_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionIdentifierLoadIndexesIntoMemory_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/loadIndexesIntoMemory</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/loadIndexesIntoMemory
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestCollectionIdentifierLoadIndexesIntoMemory_container_collapse" onclick="$('#RestCollectionIdentifierLoadIndexesIntoMemory_long').hide(); $('#RestCollectionIdentifierLoadIndexesIntoMemory_short').show(); window.location.hash='RestCollectionIdentifierLoadIndexesIntoMemory_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionIdentifierLoadIndexesIntoMemory_short" onclick="$('#RestCollectionIdentifierLoadIndexesIntoMemory_short').hide(); $('#RestCollectionIdentifierLoadIndexesIntoMemory_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/collection/products/loadIndexesIntoMemory</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
location: <span class="hljs-regexp">/_api/</span>collection/products/loadIndexesIntoMemory
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md -->
@startDocuBlock post_api_collection
@brief creates a collection
@RESTHEADER{POST /_api/collection, Create collection, handleCommandPost:CreateCollection}
@HINTS
{% hint 'warning' %}
Accessing collections by their numeric ID is deprecated from version 3.4.0 on.
You should reference them via their names instead.
{% endhint %}
@RESTDESCRIPTION
Creates a new collection with a given name. The request must contain an
object with the following attributes.
@RESTBODYPARAM{name,string,required,string}
The name of the collection.
@RESTBODYPARAM{waitForSync,boolean,optional,}
If *true* then the data is synchronized to disk before returning from a
document create, update, replace or removal operation. (default: false)
@RESTBODYPARAM{doCompact,boolean,optional,}
whether or not the collection will be compacted (default is *true*)
This option is meaningful for the MMFiles storage engine only.
@RESTBODYPARAM{journalSize,integer,optional,int64}
The maximal size of a journal or datafile in bytes. The value
must be at least `1048576` (1 MiB). (The default is a configuration parameter)
This option is meaningful for the MMFiles storage engine only.
@RESTBODYPARAM{isSystem,boolean,optional,}
If *true*, create a system collection. In this case *collection-name*
should start with an underscore. End users should normally create non-system
collections only. API implementors may be required to create system
collections in very special occasions, but normally a regular collection will do.
(The default is *false*)
@RESTBODYPARAM{isVolatile,boolean,optional,}
If *true* then the collection data is kept in-memory only and not made persistent.
Unloading the collection will cause the collection data to be discarded. Stopping
or re-starting the server will also cause full loss of data in the
collection. Setting this option will make the resulting collection be
slightly faster than regular collections because ArangoDB does not
enforce any synchronization to disk and does not calculate any CRC
checksums for datafiles (as there are no datafiles). This option
should therefore be used for cache-type collections only, and not
for data that cannot be re-created otherwise.
(The default is *false*)
This option is meaningful for the MMFiles storage engine only.
@RESTBODYPARAM{keyOptions,object,optional,post_api_collection_opts}
additional options for key generation. If specified, then *keyOptions*
should be a JSON array containing the following attributes:
@RESTSTRUCT{type,post_api_collection_opts,string,required,string}
specifies the type of the key generator. The currently available generators are
*traditional*, *autoincrement*, *uuid* and *padded*.
The *traditional* key generator generates numerical keys in ascending order.
The *autoincrement* key generator generates numerical keys in ascending order,
the inital offset and the spacing can be configured
The *padded* key generator generates keys of a fixed length (16 bytes) in
ascending lexicographical sort order. This is ideal for usage with the _RocksDB_
engine, which will slightly benefit keys that are inserted in lexicographically
ascending order. The key generator can be used in a single-server or cluster.
The *uuid* key generator generates universally unique 128 bit keys, which
are stored in hexadecimal human-readable format. This key generator can be used
in a single-server or cluster to generate "seemingly random" keys. The keys
produced by this key generator are not lexicographically sorted.
@RESTSTRUCT{allowUserKeys,post_api_collection_opts,boolean,required,}
if set to *true*, then it is allowed to supply own key values in the
*_key* attribute of a document. If set to *false*, then the key generator
will solely be responsible for generating keys and supplying own key values
in the *_key* attribute of documents is considered an error.
@RESTSTRUCT{increment,post_api_collection_opts,integer,required,int64}
increment value for *autoincrement* key generator. Not used for other key
generator types.
@RESTSTRUCT{offset,post_api_collection_opts,integer,required,int64}
Initial offset value for *autoincrement* key generator.
Not used for other key generator types.
@RESTBODYPARAM{type,integer,optional,int64}
(The default is *2*): the type of the collection to create.
The following values for *type* are valid:
- *2*: document collection
- *3*: edge collection
@RESTBODYPARAM{indexBuckets,integer,optional,int64}
The number of buckets into which indexes using a hash
table are split. The default is 16 and this number has to be a
power of 2 and less than or equal to 1024.
For very large collections one should increase this to avoid long pauses
when the hash table has to be initially built or resized, since buckets
are resized individually and can be initially built in parallel. For
example, 64 might be a sensible value for a collection with 100
000 000 documents. Currently, only the edge index respects this
value, but other index types might follow in future ArangoDB versions.
Changes (see below) are applied when the collection is loaded the next
time.
This option is meaningful for the MMFiles storage engine only.
@RESTBODYPARAM{numberOfShards,integer,optional,int64}
(The default is *1*): in a cluster, this value determines the
number of shards to create for the collection. In a single
server setup, this option is meaningless.
@RESTBODYPARAM{shardKeys,string,optional,string}
(The default is *[ "_key" ]*): in a cluster, this attribute determines
which document attributes are used to determine the target shard for documents.
Documents are sent to shards based on the values of their shard key attributes.
The values of all shard key attributes in a document are hashed,
and the hash value is used to determine the target shard.
**Note**: Values of shard key attributes cannot be changed once set.
This option is meaningless in a single server setup.
@RESTBODYPARAM{replicationFactor,integer,optional,int64}
(The default is *1*): in a cluster, this attribute determines how many copies
of each shard are kept on different DBServers. The value 1 means that only one
copy (no synchronous replication) is kept. A value of k means that k-1 replicas
are kept. Any two copies reside on different DBServers. Replication between them is
synchronous, that is, every write operation to the "leader" copy will be replicated
to all "follower" replicas, before the write operation is reported successful.
If a server fails, this is detected automatically and one of the servers holding
copies take over, usually without an error being reported.
@RESTBODYPARAM{distributeShardsLike,string,optional,string}
(The default is *""*): in an Enterprise Edition cluster, this attribute binds
the specifics of sharding for the newly created collection to follow that of a
specified existing collection.
**Note**: Using this parameter has consequences for the prototype
collection. It can no longer be dropped, before the sharding-imitating
collections are dropped. Equally, backups and restores of imitating
collections alone will generate warnings (which can be overridden)
about missing sharding prototype.
@RESTBODYPARAM{shardingStrategy,string,optional,string}
This attribute specifies the name of the sharding strategy to use for
the collection. Since ArangoDB 3.4 there are different sharding strategies
to select from when creating a new collection. The selected *shardingStrategy*
value will remain fixed for the collection and cannot be changed afterwards.
This is important to make the collection keep its sharding settings and
always find documents already distributed to shards using the same
initial sharding algorithm.
The available sharding strategies are:
- `community-compat`: default sharding used by ArangoDB
Community Edition before version 3.4
- `enterprise-compat`: default sharding used by ArangoDB
Enterprise Edition before version 3.4
- `enterprise-smart-edge-compat`: default sharding used by smart edge
collections in ArangoDB Enterprise Edition before version 3.4
- `hash`: default sharding used for new collections starting from version 3.4
(excluding smart edge collections)
- `enterprise-hash-smart-edge`: default sharding used for new
smart edge collections starting from version 3.4
If no sharding strategy is specified, the default will be *hash* for
all collections, and *enterprise-hash-smart-edge* for all smart edge
collections (requires the *Enterprise Edition* of ArangoDB).
Manually overriding the sharding strategy does not yet provide a
benefit, but it may later in case other sharding strategies are added.
@RESTBODYPARAM{smartJoinAttribute,string,optional,string}
In an *Enterprise Edition* cluster, this attribute determines an attribute
of the collection that must contain the shard key value of the referred-to
smart join collection. Additionally, the shard key for a document in this
collection must contain the value of this attribute, followed by a colon,
followed by the actual primary key of the document.
This feature can only be used in the *Enterprise Edition* and requires the
*distributeShardsLike* attribute of the collection to be set to the name
of another collection. It also requires the *shardKeys* attribute of the
collection to be set to a single shard key attribute, with an additional ':'
at the end.
A further restriction is that whenever documents are stored or updated in the
collection, the value stored in the *smartJoinAttribute* must be a string.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSyncReplication,integer,optional}
Default is *1* which means the server will only report success back to the
client if all replicas have created the collection. Set to *0* if you want
faster server responses and don't care about full replication.
@RESTQUERYPARAM{enforceReplicationFactor,integer,optional}
Default is *1* which means the server will check if there are enough replicas
available at creation time and bail out otherwise. Set to *0* to disable
this extra check.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *collection-name* is missing, then a *HTTP 400* is
returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@RESTRETURNCODE{200}
@RESTREPLYBODY{,object,required,collection_info}
@EXAMPLES
<div class="example-container" id="RestCollectionCreateCollection_container">
<a class="anchorjs-link " href="#RestCollectionCreateCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionCreateCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionBasics"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69096"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69095"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69096"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionBasics"</span>
}
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionEdges"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">3</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69101"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69100"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69101"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionEdges"</span>
}
</pre>
<div id="RestCollectionCreateCollection_container_collapse" onclick="$('#RestCollectionCreateCollection_long').hide(); $('#RestCollectionCreateCollection_short').show(); window.location.hash='RestCollectionCreateCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionCreateCollection_short" onclick="$('#RestCollectionCreateCollection_short').hide(); $('#RestCollectionCreateCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionBasics"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionEdges"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">3</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
<div class="example-container" id="RestCollectionCreateKeyopt_container">
<a class="anchorjs-link " href="#RestCollectionCreateKeyopt_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCollectionCreateKeyopt_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionUsers"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"autoincrement"</span>,
<span class="hljs-string">"increment"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"statusString"</span> : <span class="hljs-string">"loaded"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"69111"</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"objectId"</span> : <span class="hljs-string">"69110"</span>,
<span class="hljs-string">"cacheEnabled"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/69111"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"autoincrement"</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"increment"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionUsers"</span>
}
</pre>
<div id="RestCollectionCreateKeyopt_container_collapse" onclick="$('#RestCollectionCreateKeyopt_long').hide(); $('#RestCollectionCreateKeyopt_short').show(); window.location.hash='RestCollectionCreateKeyopt_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCollectionCreateKeyopt_short" onclick="$('#RestCollectionCreateKeyopt_short').hide(); $('#RestCollectionCreateKeyopt_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollectionUsers"</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"autoincrement"</span>,
<span class="hljs-string">"increment"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_delete.md -->
@startDocuBlock post_api_index_delete
@brief deletes an index
@RESTHEADER{DELETE /_api/index/{index-handle}, Delete index, dropIndex}
@RESTURLPARAMETERS
@RESTURLPARAM{index-handle,string,required}
The index handle.
@RESTDESCRIPTION
Deletes an index with *index-handle*.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index could be deleted, then an *HTTP 200* is
returned.
@RESTRETURNCODE{404}
If the *index-handle* is unknown, then an *HTTP 404* is returned.
@EXAMPLES
<div class="example-container" id="RestIndexDeleteUniqueSkiplist_container">
<a class="anchorjs-link " href="#RestIndexDeleteUniqueSkiplist_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexDeleteUniqueSkiplist_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/index/products/70482</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70482"</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestIndexDeleteUniqueSkiplist_container_collapse" onclick="$('#RestIndexDeleteUniqueSkiplist_long').hide(); $('#RestIndexDeleteUniqueSkiplist_short').show(); window.location.hash='RestIndexDeleteUniqueSkiplist_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexDeleteUniqueSkiplist_short" onclick="$('#RestIndexDeleteUniqueSkiplist_short').hide(); $('#RestIndexDeleteUniqueSkiplist_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/index/products/70482</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_hash.md -->
@startDocuBlock post_api_index_hash
@brief creates a hash index
@RESTHEADER{POST /_api/index#hash, Create hash index, createIndex:hash}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection-name,string,required}
The collection name.
@RESTBODYPARAM{type,string,required,string}
must be equal to *"hash"*.
@RESTBODYPARAM{fields,array,required,string}
an array of attribute paths.
@RESTBODYPARAM{unique,boolean,required,}
if *true*, then create a unique index.
@RESTBODYPARAM{sparse,boolean,required,}
if *true*, then create a sparse index.
@RESTBODYPARAM{deduplicate,boolean,optional,boolean}
if *false*, the deduplication of array values is turned off.
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates a hash index for the collection *collection-name* if it
does not already exist. The call expects an object containing the index
details.
In a sparse index all documents will be excluded from the index that do not
contain at least one of the specified index attributes (i.e. *fields*) or that
have a value of *null* in any of the specified index attributes. Such documents
will not be indexed, and not be taken into account for uniqueness checks if
the *unique* flag is set.
In a non-sparse index, these documents will be indexed (for non-present
indexed attributes, a value of *null* will be used) and will be taken into
account for uniqueness checks if the *unique* flag is set.
**Note**: unique indexes on non-shard keys are not supported in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.
@RESTRETURNCODE{400}
If the collection already contains documents and you try to create a unique
hash index in such a way that there are documents violating the uniqueness,
then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Creating an unique constraint
<div class="example-container" id="RestIndexCreateNewUniqueConstraint_container">
<a class="anchorjs-link " href="#RestIndexCreateNewUniqueConstraint_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateNewUniqueConstraint_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70438"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074414759938"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateNewUniqueConstraint_container_collapse" onclick="$('#RestIndexCreateNewUniqueConstraint_long').hide(); $('#RestIndexCreateNewUniqueConstraint_short').show(); window.location.hash='RestIndexCreateNewUniqueConstraint_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateNewUniqueConstraint_short" onclick="$('#RestIndexCreateNewUniqueConstraint_short').hide(); $('#RestIndexCreateNewUniqueConstraint_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Creating a non-unique hash index
<div class="example-container" id="RestIndexCreateNewHashIndex_container">
<a class="anchorjs-link " href="#RestIndexCreateNewHashIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateNewHashIndex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70394"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074400079872"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateNewHashIndex_container_collapse" onclick="$('#RestIndexCreateNewHashIndex_long').hide(); $('#RestIndexCreateNewHashIndex_short').show(); window.location.hash='RestIndexCreateNewHashIndex_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateNewHashIndex_short" onclick="$('#RestIndexCreateNewHashIndex_short').hide(); $('#RestIndexCreateNewHashIndex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Creating a sparse index
<div class="example-container" id="RestIndexCreateSparseHashIndex_container">
<a class="anchorjs-link " href="#RestIndexCreateSparseHashIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateSparseHashIndex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70449"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074418954242"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateSparseHashIndex_container_collapse" onclick="$('#RestIndexCreateSparseHashIndex_long').hide(); $('#RestIndexCreateSparseHashIndex_short').show(); window.location.hash='RestIndexCreateSparseHashIndex_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateSparseHashIndex_short" onclick="$('#RestIndexCreateSparseHashIndex_short').hide(); $('#RestIndexCreateSparseHashIndex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_geo.md -->
@startDocuBlock post_api_index_geo
@brief creates a geo index
@RESTHEADER{POST /_api/index#geo, Create geo-spatial index, createIndex#geo}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,required}
The collection name.
@RESTBODYPARAM{type,string,required,string}
must be equal to *"geo"*.
@RESTBODYPARAM{fields,array,required,string}
An array with one or two attribute paths.
If it is an array with one attribute path *location*, then a geo-spatial
index on all documents is created using *location* as path to the
coordinates. The value of the attribute must be an array with at least two
double values. The array must contain the latitude (first value) and the
longitude (second value). All documents, which do not have the attribute
path or with value that are not suitable, are ignored.
If it is an array with two attribute paths *latitude* and *longitude*,
then a geo-spatial index on all documents is created using *latitude*
and *longitude* as paths the latitude and the longitude. The value of
the attribute *latitude* and of the attribute *longitude* must a
double. All documents, which do not have the attribute paths or which
values are not suitable, are ignored.
@RESTBODYPARAM{geoJson,string,required,string}
If a geo-spatial index on a *location* is constructed
and *geoJson* is *true*, then the order within the array is longitude
followed by latitude. This corresponds to the format described in
http://geojson.org/geojson-spec.html#positions
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates a geo-spatial index in the collection *collection-name*, if
it does not already exist. Expects an object containing the index details.
Geo indexes are always sparse, meaning that documents that do not contain
the index attributes or have non-numeric values in the index attributes
will not be indexed.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Creating a geo index with a location attribute
<div class="example-container" id="RestIndexCreateGeoLocation_container">
<a class="anchorjs-link " href="#RestIndexCreateGeoLocation_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateGeoLocation_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70372"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074391691266"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateGeoLocation_container_collapse" onclick="$('#RestIndexCreateGeoLocation_long').hide(); $('#RestIndexCreateGeoLocation_short').show(); window.location.hash='RestIndexCreateGeoLocation_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateGeoLocation_short" onclick="$('#RestIndexCreateGeoLocation_short').hide(); $('#RestIndexCreateGeoLocation_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Creating a geo index with latitude and longitude attributes
<div class="example-container" id="RestIndexCreateGeoLatitudeLongitude_container">
<a class="anchorjs-link " href="#RestIndexCreateGeoLatitudeLongitude_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateGeoLatitudeLongitude_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"e"</span>,
<span class="hljs-string">"f"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"bestIndexedLevel"</span> : <span class="hljs-number">17</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"e"</span>,
<span class="hljs-string">"f"</span>
],
<span class="hljs-string">"geoJson"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70361"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"maxNumCoverCells"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074388545536"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"worstIndexedLevel"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateGeoLatitudeLongitude_container_collapse" onclick="$('#RestIndexCreateGeoLatitudeLongitude_long').hide(); $('#RestIndexCreateGeoLatitudeLongitude_short').show(); window.location.hash='RestIndexCreateGeoLatitudeLongitude_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateGeoLatitudeLongitude_short" onclick="$('#RestIndexCreateGeoLatitudeLongitude_short').hide(); $('#RestIndexCreateGeoLatitudeLongitude_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"geo"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"e"</span>,
<span class="hljs-string">"f"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/get_api_index.md -->
@startDocuBlock get_api_index
@brief returns all indexes of a collection
@RESTHEADER{GET /_api/index, Read all indexes of a collection, getIndexes}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,required}
The collection name.
@RESTDESCRIPTION
Returns an object with an attribute *indexes* containing an array of all
index descriptions for the given collection. The same information is also
available in the *identifiers* as an object with the index handles as
keys.
@RESTRETURNCODES
@RESTRETURNCODE{200}
returns a JSON object containing a list of indexes on that collection.
@EXAMPLES
Return information about all indexes
<div class="example-container" id="RestIndexAllIndexes_container">
<a class="anchorjs-link " href="#RestIndexAllIndexes_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexAllIndexes_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/index?collection=products</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"name"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70345"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074382254082"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"price"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70349"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074382254083"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
}
],
<span class="hljs-string">"identifiers"</span> : {
<span class="hljs-string">"products/0"</span> : {
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"products/70345"</span> : {
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"name"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70345"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074382254082"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"products/70349"</span> : {
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"price"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70349"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074382254083"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>
}
}
}
</pre>
<div id="RestIndexAllIndexes_container_collapse" onclick="$('#RestIndexAllIndexes_long').hide(); $('#RestIndexAllIndexes_short').show(); window.location.hash='RestIndexAllIndexes_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexAllIndexes_short" onclick="$('#RestIndexAllIndexes_short').hide(); $('#RestIndexAllIndexes_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/index?collection=products</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/get_api_reads_index.md -->
@startDocuBlock get_api_reads_index
@brief returns an index
@RESTHEADER{GET /_api/index/{index-handle},Read index, getIndexes:handle}
@RESTURLPARAMETERS
@RESTURLPARAM{index-handle,string,required}
The index-handle.
@RESTDESCRIPTION
The result is an object describing the index. It has at least the following
attributes:
- *id*: the identifier of the index
- *type*: the index type
All other attributes are type-dependent. For example, some indexes provide
*unique* or *sparse* flags, whereas others don't. Some indexes also provide
a selectivity estimate in the *selectivityEstimate* attribute of the result.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index exists, then a *HTTP 200* is returned.
@RESTRETURNCODE{404}
If the index does not exist, then a *HTTP 404*
is returned.
@EXAMPLES
<div class="example-container" id="RestIndexPrimaryIndex_container">
<a class="anchorjs-link " href="#RestIndexPrimaryIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexPrimaryIndex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/index/products/0</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/0"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"primary"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestIndexPrimaryIndex_container_collapse" onclick="$('#RestIndexPrimaryIndex_long').hide(); $('#RestIndexPrimaryIndex_short').show(); window.location.hash='RestIndexPrimaryIndex_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexPrimaryIndex_short" onclick="$('#RestIndexPrimaryIndex_short').hide(); $('#RestIndexPrimaryIndex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/index/products/0</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_fulltext.md -->
@startDocuBlock post_api_index_fulltext
@brief creates a fulltext index
@RESTHEADER{POST /_api/index#fulltext, Create fulltext index, createIndex#fulltext}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection-name,string,required}
The collection name.
@RESTBODYPARAM{type,string,required,string}
must be equal to *"fulltext"*.
@RESTBODYPARAM{fields,array,required,string}
an array of attribute names. Currently, the array is limited
to exactly one attribute.
@RESTBODYPARAM{minLength,integer,required,int64}
Minimum character length of words to index. Will default
to a server-defined value if unspecified. It is thus recommended to set
this value explicitly when creating the index.
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates a fulltext index for the collection *collection-name*, if
it does not already exist. The call expects an object containing the index
details.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is
returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Creating a fulltext index
<div class="example-container" id="RestIndexCreateNewFulltext_container">
<a class="anchorjs-link " href="#RestIndexCreateNewFulltext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateNewFulltext_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"fulltext"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"text"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"text"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70383"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"minLength"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074395885570"</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"fulltext"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateNewFulltext_container_collapse" onclick="$('#RestIndexCreateNewFulltext_long').hide(); $('#RestIndexCreateNewFulltext_short').show(); window.location.hash='RestIndexCreateNewFulltext_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateNewFulltext_short" onclick="$('#RestIndexCreateNewFulltext_short').hide(); $('#RestIndexCreateNewFulltext_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"fulltext"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"text"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_persistent.md -->
@startDocuBlock post_api_index_persistent
@brief creates a persistent index
@RESTHEADER{POST /_api/index#persistent, Create a persistent index, createIndex:persistent}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection-name,string,required}
The collection name.
@RESTBODYPARAM{type,string,required,string}
must be equal to *"persistent"*.
@RESTBODYPARAM{fields,array,required,string}
an array of attribute paths.
@RESTBODYPARAM{unique,boolean,required,}
if *true*, then create a unique index.
@RESTBODYPARAM{sparse,boolean,required,}
if *true*, then create a sparse index.
@RESTDESCRIPTION
Creates a persistent index for the collection *collection-name*, if
it does not already exist. The call expects an object containing the index
details.
In a sparse index all documents will be excluded from the index that do not
contain at least one of the specified index attributes (i.e. *fields*) or that
have a value of *null* in any of the specified index attributes. Such documents
will not be indexed, and not be taken into account for uniqueness checks if
the *unique* flag is set.
In a non-sparse index, these documents will be indexed (for non-present
indexed attributes, a value of *null* will be used) and will be taken into
account for uniqueness checks if the *unique* flag is set.
**Note**: unique indexes on non-shard keys are not supported in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is
returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.
@RESTRETURNCODE{400}
If the collection already contains documents and you try to create a unique
persistent index in such a way that there are documents violating the
uniqueness, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Creating a persistent index
<div class="example-container" id="RestIndexCreateNewPersistent_container">
<a class="anchorjs-link " href="#RestIndexCreateNewPersistent_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateNewPersistent_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70405"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074404274176"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateNewPersistent_container_collapse" onclick="$('#RestIndexCreateNewPersistent_long').hide(); $('#RestIndexCreateNewPersistent_short').show(); window.location.hash='RestIndexCreateNewPersistent_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateNewPersistent_short" onclick="$('#RestIndexCreateNewPersistent_short').hide(); $('#RestIndexCreateNewPersistent_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Creating a sparse persistent index
<div class="example-container" id="RestIndexCreateSparsePersistent_container">
<a class="anchorjs-link " href="#RestIndexCreateSparsePersistent_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateSparsePersistent_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70460"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074423148544"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateSparsePersistent_container_collapse" onclick="$('#RestIndexCreateSparsePersistent_long').hide(); $('#RestIndexCreateSparsePersistent_short').show(); window.location.hash='RestIndexCreateSparsePersistent_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateSparsePersistent_short" onclick="$('#RestIndexCreateSparsePersistent_short').hide(); $('#RestIndexCreateSparsePersistent_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"persistent"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index.md -->
@startDocuBlock post_api_index
@brief creates an index
@RESTHEADER{POST /_api/index#general, Create index, createIndex:general}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,required}
The collection name.
@RESTALLBODYPARAM{index-details,json,required}
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates a new index in the collection *collection*. Expects
an object containing the index details.
The type of the index to be created must specified in the *type*
attribute of the index details. Depending on the index type, additional
other attributes may need to specified in the request in order to create
the index.
Indexes require the to be indexed attribute(s) in the *fields* attribute
of the index details. Depending on the index type, a single attribute or
multiple attributes can be indexed. In the latter case, an array of
strings is expected.
Indexing the system attribute *_id* is not supported for user-defined indexes.
Manually creating an index using *_id* as an index attribute will fail with
an error.
Optionally, an index name may be specified as a string in the *name* attribute.
Index names have the same restrictions as collection names. If no value is
specified, one will be auto-generated.
Some indexes can be created as unique or non-unique variants. Uniqueness
can be controlled for most indexes by specifying the *unique* flag in the
index details. Setting it to *true* will create a unique index.
Setting it to *false* or omitting the *unique* attribute will
create a non-unique index.
**Note**: The following index types do not support uniqueness, and using
the *unique* attribute with these types may lead to an error:
- geo indexes
- fulltext indexes
**Note**: Unique indexes on non-shard keys are not supported in a
cluster.
Hash, skiplist and persistent indexes can optionally be created in a sparse
variant. A sparse index will be created if the *sparse* attribute in
the index details is set to *true*. Sparse indexes do not index documents
for which any of the index attributes is either not set or is *null*.
The optional attribute **deduplicate** is supported by array indexes of
type *hash* or *skiplist*. It controls whether inserting duplicate index values
from the same document into a unique array index will lead to a unique constraint
error or not. The default value is *true*, so only a single instance of each
non-unique index value will be inserted into the index per document. Trying to
insert a value into the index that already exists in the index will always fail,
regardless of the value of this attribute.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then an *HTTP 200* is returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then an *HTTP 201*
is returned.
@RESTRETURNCODE{400}
If an invalid index description is posted or attributes are used that the
target index will not support, then an *HTTP 400* is returned.
@RESTRETURNCODE{404}
If *collection* is unknown, then an *HTTP 404* is returned.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_skiplist.md -->
@startDocuBlock post_api_index_skiplist
@brief creates a skip-list
@RESTHEADER{POST /_api/index#skiplist, Create skip list, createIndex:skiplist}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection-name,string,required}
The collection name.
@RESTBODYPARAM{type,string,required,string}
must be equal to *"skiplist"*.
@RESTBODYPARAM{fields,array,required,string}
an array of attribute paths.
@RESTBODYPARAM{unique,boolean,required,}
if *true*, then create a unique index.
@RESTBODYPARAM{sparse,boolean,required,}
if *true*, then create a sparse index.
@RESTBODYPARAM{deduplicate,boolean,optional,boolean}
if *false*, the deduplication of array values is turned off.
@RESTDESCRIPTION
Creates a skip-list index for the collection *collection-name*, if
it does not already exist. The call expects an object containing the index
details.
In a sparse index all documents will be excluded from the index that do not
contain at least one of the specified index attributes (i.e. *fields*) or that
have a value of *null* in any of the specified index attributes. Such documents
will not be indexed, and not be taken into account for uniqueness checks if
the *unique* flag is set.
In a non-sparse index, these documents will be indexed (for non-present
indexed attributes, a value of *null* will be used) and will be taken into
account for uniqueness checks if the *unique* flag is set.
**Note**: unique indexes on non-shard keys are not supported in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is
returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.
@RESTRETURNCODE{400}
If the collection already contains documents and you try to create a unique
skip-list index in such a way that there are documents violating the
uniqueness, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Creating a skiplist index
<div class="example-container" id="RestIndexCreateNewSkiplist_container">
<a class="anchorjs-link " href="#RestIndexCreateNewSkiplist_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateNewSkiplist_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70416"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074407419906"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateNewSkiplist_container_collapse" onclick="$('#RestIndexCreateNewSkiplist_long').hide(); $('#RestIndexCreateNewSkiplist_short').show(); window.location.hash='RestIndexCreateNewSkiplist_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateNewSkiplist_short" onclick="$('#RestIndexCreateNewSkiplist_short').hide(); $('#RestIndexCreateNewSkiplist_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Creating a sparse skiplist index
<div class="example-container" id="RestIndexCreateSparseSkiplist_container">
<a class="anchorjs-link " href="#RestIndexCreateSparseSkiplist_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateSparseSkiplist_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"products/70471"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074426294274"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateSparseSkiplist_container_collapse" onclick="$('#RestIndexCreateSparseSkiplist_long').hide(); $('#RestIndexCreateSparseSkiplist_short').show(); window.location.hash='RestIndexCreateSparseSkiplist_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateSparseSkiplist_short" onclick="$('#RestIndexCreateSparseSkiplist_short').hide(); $('#RestIndexCreateSparseSkiplist_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=products</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Indexes/post_api_index_ttl.md -->
@startDocuBlock post_api_index_ttl
@brief creates a TTL (time-to-live) index
@RESTHEADER{POST /_api/index#ttl, Create TTL index, createIndex:ttl}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection-name,string,required}
The collection name.
@RESTBODYPARAM{type,string,required,string}
must be equal to *"ttl"*.
@RESTBODYPARAM{fields,array,required,string}
an array with exactly one attribute path.
@RESTBODYPARAM{expireAfter,number,required,}
The time (in seconds) after a document's creation after which the
documents count as "expired".
@RESTDESCRIPTION
**NOTE** Swagger examples won't work due to the anchor.
Creates a TTL index for the collection *collection-name* if it
does not already exist. The call expects an object containing the index
details.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the index already exists, then a *HTTP 200* is returned.
@RESTRETURNCODE{201}
If the index does not already exist and could be created, then a *HTTP 201*
is returned.
@RESTRETURNCODE{400}
If the collection already contains another TTL index, then an *HTTP 400* is
returned, as there can be at most one TTL index per collection.
@RESTRETURNCODE{404}
If the *collection-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Creating a TTL index
<div class="example-container" id="RestIndexCreateNewTtlIndex_container">
<a class="anchorjs-link " href="#RestIndexCreateNewTtlIndex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestIndexCreateNewTtlIndex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=sessions</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ttl"</span>,
<span class="hljs-string">"expireAfter"</span> : <span class="hljs-number">3600</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"createdAt"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"expireAfter"</span> : <span class="hljs-number">3600</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"createdAt"</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-string">"sessions/70427"</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074411614208"</span>,
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ttl"</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestIndexCreateNewTtlIndex_container_collapse" onclick="$('#RestIndexCreateNewTtlIndex_long').hide(); $('#RestIndexCreateNewTtlIndex_short').show(); window.location.hash='RestIndexCreateNewTtlIndex_container';" class="example_show_button">Hide response body</div></div>
<div id="RestIndexCreateNewTtlIndex_short" onclick="$('#RestIndexCreateNewTtlIndex_short').hide(); $('#RestIndexCreateNewTtlIndex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/index?collection=sessions</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ttl"</span>,
<span class="hljs-string">"expireAfter"</span> : <span class="hljs-number">3600</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"createdAt"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_create
@brief Create a new user.
@RESTHEADER{POST /_api/user, Create User}
@RESTBODYPARAM{user,string,required,string}
The name of the user as a string. This is mandatory.
@RESTBODYPARAM{passwd,string,required,string}
The user password as a string. If no password is specified, the empty string
will be used. If you pass the special value *ARANGODB_DEFAULT_ROOT_PASSWORD*,
then the password will be set the value stored in the environment variable
`ARANGODB_DEFAULT_ROOT_PASSWORD`. This can be used to pass an instance
variable into ArangoDB. For example, the instance identifier from Amazon.
@RESTBODYPARAM{active,boolean,optional,boolean}
An optional flag that specifies whether the user is active. If not
specified, this will default to true
@RESTBODYPARAM{extra,object,optional,}
An optional JSON object with arbitrary extra data about the user.
@RESTDESCRIPTION
Create a new user. You need server access level *Administrate* in order to
execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the user can be added by the server
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{409}
Returned if a user with the same name already exists.
@EXAMPLES
<div class="example-container" id="RestCreateUser_container">
<a class="anchorjs-link " href="#RestCreateUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCreateUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user</span> &lt;&lt;EOF
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@example"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@example"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCreateUser_container_collapse" onclick="$('#RestCreateUser_long').hide(); $('#RestCreateUser_short').show(); window.location.hash='RestCreateUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCreateUser_short" onclick="$('#RestCreateUser_short').hide(); $('#RestCreateUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user</span> &lt;&lt;EOF
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@example"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_grantDatabase
@brief Set the database access level.
@RESTHEADER{PUT /_api/user/{user}/database/{dbname}, Set the database access level}
@RESTBODYPARAM{grant,string,required,string}
Use "rw" to set the database access level to *Administrate* .
Use "ro" to set the database access level to *Access*.
Use "none" to set the database access level to *No access*.
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTDESCRIPTION
Sets the database access levels for the database *dbname* of user *user*. You
need the *Administrate* server access level in order to execute this REST
call.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the access level was changed successfully.
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestGrantDatabase_container">
<a class="anchorjs-link " href="#RestGrantDatabase_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGrantDatabase_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_system"</span> : <span class="hljs-string">"rw"</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestGrantDatabase_container_collapse" onclick="$('#RestGrantDatabase_long').hide(); $('#RestGrantDatabase_short').show(); window.location.hash='RestGrantDatabase_container';" class="example_show_button">Hide response body</div></div>
<div id="RestGrantDatabase_short" onclick="$('#RestGrantDatabase_short').hide(); $('#RestGrantDatabase_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_revokeDatabase
@brief Clear the database access level, revert back to the default access level
@RESTHEADER{DELETE /_api/user/{user}/database/{dbname}, Clear the database access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTDESCRIPTION
Clears the database access level for the database *dbname* of user *user*. As
consequence the default database access level is used. If there is no defined
default database access level, it defaults to *No access*. You need permission
to the *_system* database in order to execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{202}
Returned if the access permissions were changed successfully.
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@EXAMPLES
<div class="example-container" id="RestRevokeDatabase_container">
<a class="anchorjs-link " href="#RestRevokeDatabase_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestRevokeDatabase_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/admin@myapp/database/_system</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_grantCollection
@brief Set the collection access level.
@RESTHEADER{PUT /_api/user/{user}/database/{dbname}/{collection}, Set the collection access level}
@RESTBODYPARAM{grant,string,required,string}
Use "rw" to set the collection level access to *Read/Write*.
Use "ro" to set the collection level access to *Read Only*.
Use "none" to set the collection level access to *No access*.
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTURLPARAM{collection,string,required}
The name of the collection.
@RESTDESCRIPTION
Sets the collection access level for the *collection* in the database *dbname*
for user *user*. You need the *Administrate* server access level in order to
execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the access permissions were changed successfully.
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestGrantCollection_container">
<a class="anchorjs-link " href="#RestGrantCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGrantCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system/reports</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_system/reports"</span> : <span class="hljs-string">"rw"</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestGrantCollection_container_collapse" onclick="$('#RestGrantCollection_long').hide(); $('#RestGrantCollection_short').show(); window.location.hash='RestGrantCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="RestGrantCollection_short" onclick="$('#RestGrantCollection_short').hide(); $('#RestGrantCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system/reports</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_revokeCollection
@brief Clear the collection access level, revert back to the default access level
@RESTHEADER{DELETE /_api/user/{user}/database/{dbname}/{collection}, Clear the collection access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTURLPARAM{collection,string,required}
The name of the collection.
@RESTDESCRIPTION
Clears the collection access level for the collection *collection* in the
database *dbname* of user *user*. As consequence the default collection
access level is used. If there is no defined default collection access level,
it defaults to *No access*. You need permissions to the *_system* database in
order to execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{202}
Returned if the access permissions were changed successfully.
@RESTRETURNCODE{400}
If there was an error
@EXAMPLES
<div class="example-container" id="RestRevokeCollection_container">
<a class="anchorjs-link " href="#RestRevokeCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestRevokeCollection_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/admin@myapp/database/_system/reports</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_fetchDatabaseList
@brief List the accessible databases for a user
@RESTHEADER{GET /_api/user/{user}/database/, List the accessible databases for a user}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user for which you want to query the databases.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{full,boolean,optional}
Return the full set of access levels for all databases and all collections.
@RESTDESCRIPTION
Fetch the list of databases available to the specified *user*. You need
*Administrate* for the server access level in order to execute this REST call.
The call will return a JSON object with the per-database access
privileges for the specified user. The *result* object will contain
the databases names as object keys, and the associated privileges
for the database as values.
In case you specified *full*, the result will contain the permissions
for the databases as well as the permissions for the collections.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the list of available databases can be returned.
@RESTRETURNCODE{400}
If the access privileges are not right etc.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchUserDatabaseList_container">
<a class="anchorjs-link " href="#RestFetchUserDatabaseList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserDatabaseList_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"_system"</span> : <span class="hljs-string">"rw"</span>
}
}
</pre>
<div id="RestFetchUserDatabaseList_container_collapse" onclick="$('#RestFetchUserDatabaseList_long').hide(); $('#RestFetchUserDatabaseList_short').show(); window.location.hash='RestFetchUserDatabaseList_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserDatabaseList_short" onclick="$('#RestFetchUserDatabaseList_short').hide(); $('#RestFetchUserDatabaseList_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
With the full response format:
<div class="example-container" id="RestFetchUserDatabaseListFull_container">
<a class="anchorjs-link " href="#RestFetchUserDatabaseListFull_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserDatabaseListFull_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database?full=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"_system"</span> : {
<span class="hljs-string">"permission"</span> : <span class="hljs-string">"rw"</span>,
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"_statisticsRaw"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_statistics15"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_statistics"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_graphs"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_users"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_analyzers"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_aqlfunctions"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_queues"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_apps"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"animals"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_appbundles"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_jobs"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"demo"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_frontend"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_modules"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_fishbowl"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"*"</span> : <span class="hljs-string">"undefined"</span>
}
},
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permission"</span> : <span class="hljs-string">"none"</span>
}
}
}
</pre>
<div id="RestFetchUserDatabaseListFull_container_collapse" onclick="$('#RestFetchUserDatabaseListFull_long').hide(); $('#RestFetchUserDatabaseListFull_short').show(); window.location.hash='RestFetchUserDatabaseListFull_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserDatabaseListFull_short" onclick="$('#RestFetchUserDatabaseListFull_short').hide(); $('#RestFetchUserDatabaseListFull_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database?full=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_fetchDatabasePermission
@brief Get specific database access level
@RESTHEADER{GET /_api/user/{user}/database/{database}, Get the database access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user for which you want to query the databases.
@RESTURLPARAM{database,string,required}
The name of the database to query
@RESTDESCRIPTION
Fetch the database access level for a specific database
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the acccess level can be returned
@RESTRETURNCODE{400}
If the access privileges are not right etc.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchUserDatabasePermission_container">
<a class="anchorjs-link " href="#RestFetchUserDatabasePermission_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserDatabasePermission_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-string">"rw"</span>
}
</pre>
<div id="RestFetchUserDatabasePermission_container_collapse" onclick="$('#RestFetchUserDatabasePermission_long').hide(); $('#RestFetchUserDatabasePermission_short').show(); window.location.hash='RestFetchUserDatabasePermission_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserDatabasePermission_short" onclick="$('#RestFetchUserDatabasePermission_short').hide(); $('#RestFetchUserDatabasePermission_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_fetchCollectionPermission
@brief Get the collection access level
@RESTHEADER{GET /_api/user/{user}/database/{database}/{collection}, Get the specific collection access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user for which you want to query the databases.
@RESTURLPARAM{database,string,required}
The name of the database to query
@RESTURLPARAM{collection,string,required}
The name of the collection
@RESTDESCRIPTION
Returns the collection access level for a specific collection
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the acccess level can be returned
@RESTRETURNCODE{400}
If the access privileges are not right etc.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchUserCollectionPermission_container">
<a class="anchorjs-link " href="#RestFetchUserCollectionPermission_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserCollectionPermission_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system/_users</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-string">"none"</span>
}
</pre>
<div id="RestFetchUserCollectionPermission_container_collapse" onclick="$('#RestFetchUserCollectionPermission_long').hide(); $('#RestFetchUserCollectionPermission_short').show(); window.location.hash='RestFetchUserCollectionPermission_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserCollectionPermission_short" onclick="$('#RestFetchUserCollectionPermission_short').hide(); $('#RestFetchUserCollectionPermission_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system/_users</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_replace
@brief Replace an existing user.
@RESTHEADER{PUT /_api/user/{user}, Replace User}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user
@RESTBODYPARAM{passwd,string,required,string}
The user password as a string. Specifying a password is mandatory, but
the empty string is allowed for passwords
@RESTBODYPARAM{active,boolean,optional,boolean}
An optional flag that specifies whether the user is active. If not
specified, this will default to true
@RESTBODYPARAM{extra,object,optional,}
An optional JSON object with arbitrary extra data about the user.
@RESTDESCRIPTION
Replaces the data of an existing user. The name of an existing user must be
specified in *user*. You need server access level *Administrate* in order to
execute this REST call. Additionally, a user can change his/her own data.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the user data can be replaced by the server.
@RESTRETURNCODE{400}
The JSON representation is malformed or mandatory data is missing from the request
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{404}
The specified user does not exist
@EXAMPLES
<div class="example-container" id="RestReplaceUser_container">
<a class="anchorjs-link " href="#RestReplaceUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplaceUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@myapp"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestReplaceUser_container_collapse" onclick="$('#RestReplaceUser_long').hide(); $('#RestReplaceUser_short').show(); window.location.hash='RestReplaceUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplaceUser_short" onclick="$('#RestReplaceUser_short').hide(); $('#RestReplaceUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_modify
@brief Modify attributes of an existing user
@RESTHEADER{PATCH /_api/user/{user}, Modify User}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user
@RESTBODYPARAM{passwd,string,required,string}
The user password as a string. Specifying a password is mandatory, but
the empty string is allowed for passwords
@RESTBODYPARAM{active,boolean,optional,boolean}
An optional flag that specifies whether the user is active. If not
specified, this will default to true
@RESTBODYPARAM{extra,object,optional,}
An optional JSON object with arbitrary extra data about the user.
@RESTDESCRIPTION
Partially updates the data of an existing user. The name of an existing user
must be specified in *user*. You need server access level *Administrate* in
order to execute this REST call. Additionally, a user can change his/her own
data.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the user data can be replaced by the server.
@RESTRETURNCODE{400}
The JSON representation is malformed or mandatory data is missing from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{404}
The specified user does not exist
@EXAMPLES
<div class="example-container" id="RestUpdateUser_container">
<a class="anchorjs-link " href="#RestUpdateUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestUpdateUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@myapp"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestUpdateUser_container_collapse" onclick="$('#RestUpdateUser_long').hide(); $('#RestUpdateUser_short').show(); window.location.hash='RestUpdateUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestUpdateUser_short" onclick="$('#RestUpdateUser_short').hide(); $('#RestUpdateUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_create
@brief Create a new user.
@RESTHEADER{POST /_api/user, Create User}
@RESTBODYPARAM{user,string,required,string}
The name of the user as a string. This is mandatory.
@RESTBODYPARAM{passwd,string,required,string}
The user password as a string. If no password is specified, the empty string
will be used. If you pass the special value *ARANGODB_DEFAULT_ROOT_PASSWORD*,
then the password will be set the value stored in the environment variable
`ARANGODB_DEFAULT_ROOT_PASSWORD`. This can be used to pass an instance
variable into ArangoDB. For example, the instance identifier from Amazon.
@RESTBODYPARAM{active,boolean,optional,boolean}
An optional flag that specifies whether the user is active. If not
specified, this will default to true
@RESTBODYPARAM{extra,object,optional,}
An optional JSON object with arbitrary extra data about the user.
@RESTDESCRIPTION
Create a new user. You need server access level *Administrate* in order to
execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the user can be added by the server
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{409}
Returned if a user with the same name already exists.
@EXAMPLES
<div class="example-container" id="RestCreateUser_container">
<a class="anchorjs-link " href="#RestCreateUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestCreateUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user</span> &lt;&lt;EOF
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@example"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@example"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestCreateUser_container_collapse" onclick="$('#RestCreateUser_long').hide(); $('#RestCreateUser_short').show(); window.location.hash='RestCreateUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestCreateUser_short" onclick="$('#RestCreateUser_short').hide(); $('#RestCreateUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user</span> &lt;&lt;EOF
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@example"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_grantDatabase
@brief Set the database access level.
@RESTHEADER{PUT /_api/user/{user}/database/{dbname}, Set the database access level}
@RESTBODYPARAM{grant,string,required,string}
Use "rw" to set the database access level to *Administrate* .
Use "ro" to set the database access level to *Access*.
Use "none" to set the database access level to *No access*.
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTDESCRIPTION
Sets the database access levels for the database *dbname* of user *user*. You
need the *Administrate* server access level in order to execute this REST
call.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the access level was changed successfully.
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestGrantDatabase_container">
<a class="anchorjs-link " href="#RestGrantDatabase_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGrantDatabase_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_system"</span> : <span class="hljs-string">"rw"</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestGrantDatabase_container_collapse" onclick="$('#RestGrantDatabase_long').hide(); $('#RestGrantDatabase_short').show(); window.location.hash='RestGrantDatabase_container';" class="example_show_button">Hide response body</div></div>
<div id="RestGrantDatabase_short" onclick="$('#RestGrantDatabase_short').hide(); $('#RestGrantDatabase_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_revokeDatabase
@brief Clear the database access level, revert back to the default access level
@RESTHEADER{DELETE /_api/user/{user}/database/{dbname}, Clear the database access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTDESCRIPTION
Clears the database access level for the database *dbname* of user *user*. As
consequence the default database access level is used. If there is no defined
default database access level, it defaults to *No access*. You need permission
to the *_system* database in order to execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{202}
Returned if the access permissions were changed successfully.
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@EXAMPLES
<div class="example-container" id="RestRevokeDatabase_container">
<a class="anchorjs-link " href="#RestRevokeDatabase_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestRevokeDatabase_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/admin@myapp/database/_system</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_grantCollection
@brief Set the collection access level.
@RESTHEADER{PUT /_api/user/{user}/database/{dbname}/{collection}, Set the collection access level}
@RESTBODYPARAM{grant,string,required,string}
Use "rw" to set the collection level access to *Read/Write*.
Use "ro" to set the collection level access to *Read Only*.
Use "none" to set the collection level access to *No access*.
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTURLPARAM{collection,string,required}
The name of the collection.
@RESTDESCRIPTION
Sets the collection access level for the *collection* in the database *dbname*
for user *user*. You need the *Administrate* server access level in order to
execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the access permissions were changed successfully.
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing
from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestGrantCollection_container">
<a class="anchorjs-link " href="#RestGrantCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestGrantCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system/reports</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"_system/reports"</span> : <span class="hljs-string">"rw"</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestGrantCollection_container_collapse" onclick="$('#RestGrantCollection_long').hide(); $('#RestGrantCollection_short').show(); window.location.hash='RestGrantCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="RestGrantCollection_short" onclick="$('#RestGrantCollection_short').hide(); $('#RestGrantCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp/database/_system/reports</span> &lt;&lt;EOF
{
<span class="hljs-string">"grant"</span> : <span class="hljs-string">"rw"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_revokeCollection
@brief Clear the collection access level, revert back to the default access level
@RESTHEADER{DELETE /_api/user/{user}/database/{dbname}/{collection}, Clear the collection access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user.
@RESTURLPARAM{dbname,string,required}
The name of the database.
@RESTURLPARAM{collection,string,required}
The name of the collection.
@RESTDESCRIPTION
Clears the collection access level for the collection *collection* in the
database *dbname* of user *user*. As consequence the default collection
access level is used. If there is no defined default collection access level,
it defaults to *No access*. You need permissions to the *_system* database in
order to execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{202}
Returned if the access permissions were changed successfully.
@RESTRETURNCODE{400}
If there was an error
@EXAMPLES
<div class="example-container" id="RestRevokeCollection_container">
<a class="anchorjs-link " href="#RestRevokeCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestRevokeCollection_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/admin@myapp/database/_system/reports</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_fetchDatabaseList
@brief List the accessible databases for a user
@RESTHEADER{GET /_api/user/{user}/database/, List the accessible databases for a user}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user for which you want to query the databases.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{full,boolean,optional}
Return the full set of access levels for all databases and all collections.
@RESTDESCRIPTION
Fetch the list of databases available to the specified *user*. You need
*Administrate* for the server access level in order to execute this REST call.
The call will return a JSON object with the per-database access
privileges for the specified user. The *result* object will contain
the databases names as object keys, and the associated privileges
for the database as values.
In case you specified *full*, the result will contain the permissions
for the databases as well as the permissions for the collections.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the list of available databases can be returned.
@RESTRETURNCODE{400}
If the access privileges are not right etc.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchUserDatabaseList_container">
<a class="anchorjs-link " href="#RestFetchUserDatabaseList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserDatabaseList_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"_system"</span> : <span class="hljs-string">"rw"</span>
}
}
</pre>
<div id="RestFetchUserDatabaseList_container_collapse" onclick="$('#RestFetchUserDatabaseList_long').hide(); $('#RestFetchUserDatabaseList_short').show(); window.location.hash='RestFetchUserDatabaseList_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserDatabaseList_short" onclick="$('#RestFetchUserDatabaseList_short').hide(); $('#RestFetchUserDatabaseList_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
With the full response format:
<div class="example-container" id="RestFetchUserDatabaseListFull_container">
<a class="anchorjs-link " href="#RestFetchUserDatabaseListFull_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserDatabaseListFull_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database?full=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"_system"</span> : {
<span class="hljs-string">"permission"</span> : <span class="hljs-string">"rw"</span>,
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"_statisticsRaw"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_statistics15"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_statistics"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_graphs"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_users"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_analyzers"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_aqlfunctions"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_queues"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_apps"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"animals"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_appbundles"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_jobs"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"demo"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_frontend"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_modules"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"_fishbowl"</span> : <span class="hljs-string">"undefined"</span>,
<span class="hljs-string">"*"</span> : <span class="hljs-string">"undefined"</span>
}
},
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permission"</span> : <span class="hljs-string">"none"</span>
}
}
}
</pre>
<div id="RestFetchUserDatabaseListFull_container_collapse" onclick="$('#RestFetchUserDatabaseListFull_long').hide(); $('#RestFetchUserDatabaseListFull_short').show(); window.location.hash='RestFetchUserDatabaseListFull_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserDatabaseListFull_short" onclick="$('#RestFetchUserDatabaseListFull_short').hide(); $('#RestFetchUserDatabaseListFull_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database?full=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_fetchDatabasePermission
@brief Get specific database access level
@RESTHEADER{GET /_api/user/{user}/database/{database}, Get the database access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user for which you want to query the databases.
@RESTURLPARAM{database,string,required}
The name of the database to query
@RESTDESCRIPTION
Fetch the database access level for a specific database
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the acccess level can be returned
@RESTRETURNCODE{400}
If the access privileges are not right etc.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchUserDatabasePermission_container">
<a class="anchorjs-link " href="#RestFetchUserDatabasePermission_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserDatabasePermission_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-string">"rw"</span>
}
</pre>
<div id="RestFetchUserDatabasePermission_container_collapse" onclick="$('#RestFetchUserDatabasePermission_long').hide(); $('#RestFetchUserDatabasePermission_short').show(); window.location.hash='RestFetchUserDatabasePermission_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserDatabasePermission_short" onclick="$('#RestFetchUserDatabasePermission_short').hide(); $('#RestFetchUserDatabasePermission_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_fetchCollectionPermission
@brief Get the collection access level
@RESTHEADER{GET /_api/user/{user}/database/{database}/{collection}, Get the specific collection access level}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user for which you want to query the databases.
@RESTURLPARAM{database,string,required}
The name of the database to query
@RESTURLPARAM{collection,string,required}
The name of the collection
@RESTDESCRIPTION
Returns the collection access level for a specific collection
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the acccess level can be returned
@RESTRETURNCODE{400}
If the access privileges are not right etc.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchUserCollectionPermission_container">
<a class="anchorjs-link " href="#RestFetchUserCollectionPermission_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUserCollectionPermission_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system/_users</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-string">"none"</span>
}
</pre>
<div id="RestFetchUserCollectionPermission_container_collapse" onclick="$('#RestFetchUserCollectionPermission_long').hide(); $('#RestFetchUserCollectionPermission_short').show(); window.location.hash='RestFetchUserCollectionPermission_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUserCollectionPermission_short" onclick="$('#RestFetchUserCollectionPermission_short').hide(); $('#RestFetchUserCollectionPermission_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/anotherAdmin@secapp/database/_system/_users</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_replace
@brief Replace an existing user.
@RESTHEADER{PUT /_api/user/{user}, Replace User}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user
@RESTBODYPARAM{passwd,string,required,string}
The user password as a string. Specifying a password is mandatory, but
the empty string is allowed for passwords
@RESTBODYPARAM{active,boolean,optional,boolean}
An optional flag that specifies whether the user is active. If not
specified, this will default to true
@RESTBODYPARAM{extra,object,optional,}
An optional JSON object with arbitrary extra data about the user.
@RESTDESCRIPTION
Replaces the data of an existing user. The name of an existing user must be
specified in *user*. You need server access level *Administrate* in order to
execute this REST call. Additionally, a user can change his/her own data.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the user data can be replaced by the server.
@RESTRETURNCODE{400}
The JSON representation is malformed or mandatory data is missing from the request
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{404}
The specified user does not exist
@EXAMPLES
<div class="example-container" id="RestReplaceUser_container">
<a class="anchorjs-link " href="#RestReplaceUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplaceUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@myapp"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestReplaceUser_container_collapse" onclick="$('#RestReplaceUser_long').hide(); $('#RestReplaceUser_short').show(); window.location.hash='RestReplaceUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplaceUser_short" onclick="$('#RestReplaceUser_short').hide(); $('#RestReplaceUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- ---------------------------------------------------------------------- -->
@startDocuBlock UserHandling_modify
@brief Modify attributes of an existing user
@RESTHEADER{PATCH /_api/user/{user}, Modify User}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user
@RESTBODYPARAM{passwd,string,required,string}
The user password as a string. Specifying a password is mandatory, but
the empty string is allowed for passwords
@RESTBODYPARAM{active,boolean,optional,boolean}
An optional flag that specifies whether the user is active. If not
specified, this will default to true
@RESTBODYPARAM{extra,object,optional,}
An optional JSON object with arbitrary extra data about the user.
@RESTDESCRIPTION
Partially updates the data of an existing user. The name of an existing user
must be specified in *user*. You need server access level *Administrate* in
order to execute this REST call. Additionally, a user can change his/her own
data.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the user data can be replaced by the server.
@RESTRETURNCODE{400}
The JSON representation is malformed or mandatory data is missing from the request.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{404}
The specified user does not exist
@EXAMPLES
<div class="example-container" id="RestUpdateUser_container">
<a class="anchorjs-link " href="#RestUpdateUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestUpdateUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@myapp"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestUpdateUser_container_collapse" onclick="$('#RestUpdateUser_long').hide(); $('#RestUpdateUser_short').show(); window.location.hash='RestUpdateUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestUpdateUser_short" onclick="$('#RestUpdateUser_short').hide(); $('#RestUpdateUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/admin@myapp</span> &lt;&lt;EOF
{
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secure"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_delete
@brief delete a user permanently.
@RESTHEADER{DELETE /_api/user/{user}, Remove User}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user
@RESTDESCRIPTION
Removes an existing user, identified by *user*. You need *Administrate* for
the server access level in order to execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{202}
Is returned if the user was removed by the server
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{404}
The specified user does not exist
@EXAMPLES
<div class="example-container" id="RestDeleteUser_container">
<a class="anchorjs-link " href="#RestDeleteUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDeleteUser_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/user/userToDelete@myapp</span> &lt;&lt;EOF
{
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_fetch
@brief fetch the properties of a user.
@RESTHEADER{GET /_api/user/{user}, Fetch User}
@RESTURLPARAMETERS
@RESTURLPARAM{user,string,required}
The name of the user
@RESTDESCRIPTION
Fetches data about the specified user. You can fetch information about
yourself or you need the *Administrate* server access level in order to
execute this REST call.
@RESTRETURNCODES
@RESTRETURNCODE{200}
The user was found.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@RESTRETURNCODE{404}
The user with the specified name does not exist.
@EXAMPLES
<div class="example-container" id="RestFetchUser_container">
<a class="anchorjs-link " href="#RestFetchUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/admin@myapp</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin@myapp"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestFetchUser_container_collapse" onclick="$('#RestFetchUser_long').hide(); $('#RestFetchUser_short').show(); window.location.hash='RestFetchUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchUser_short" onclick="$('#RestFetchUser_short').hide(); $('#RestFetchUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user/admin@myapp</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/User Management/README.md -->
@startDocuBlock UserHandling_fetchProperties
@brief fetch the properties of a user.
@RESTHEADER{GET /_api/user/, List available Users}
@RESTDESCRIPTION
Fetches data about all users. You need the *Administrate* server access level
in order to execute this REST call. Otherwise, you will only get information
about yourself.
The call will return a JSON object with at least the following
attributes on success:
- *user*: The name of the user as a string.
- *active*: An optional flag that specifies whether the user is active.
- *extra*: An optional JSON object with arbitrary extra data about the user.
@RESTRETURNCODES
@RESTRETURNCODE{200}
The users that were found.
@RESTRETURNCODE{401}
Returned if you have *No access* database access level to the *_system*
database.
@RESTRETURNCODE{403}
Returned if you have *No access* server access level.
@EXAMPLES
<div class="example-container" id="RestFetchAllUser_container">
<a class="anchorjs-link " href="#RestFetchAllUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestFetchAllUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"tester"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
}
},
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
}
},
{
<span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"extra"</span> : {
}
}
]
}
</pre>
<div id="RestFetchAllUser_container_collapse" onclick="$('#RestFetchAllUser_long').hide(); $('#RestFetchAllUser_short').show(); window.location.hash='RestFetchAllUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestFetchAllUser_short" onclick="$('#RestFetchAllUser_short').hide(); $('#RestFetchAllUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/user</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Analyzers/get_api_analyzers.md -->
@startDocuBlock get_api_analyzers
@brief returns a listing of available analyzer definitions
@RESTHEADER{GET /_api/analyzer, List all analyzers, RestAnalyzerHandler:List}
@RESTDESCRIPTION
Retrieves a an array of all analyzer definitions.
The resulting array contains objects with the following attributes:
- *name*: the analyzer name
- *type*: the analyzer type
- *properties*: the properties used to configure the specified type
- *features*: the set of features to set on the analyzer generated fields
@RESTRETURNCODES
@RESTRETURNCODE{200}
The analyzer definitions was retrieved successfully.
@EXAMPLES
Retrieve all analyzer definitions:
<div class="example-container" id="RestAnalyzersGet_container">
<a class="anchorjs-link " href="#RestAnalyzersGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAnalyzersGet_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_zh"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"zh.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_sv"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"sv.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_pt"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"pt.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_no"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"no.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_nl"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"nl.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_it"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"it.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_ru"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"ru.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_de"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"de.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"identity"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>,
<span class="hljs-string">"properties"</span> : {
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_en"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"en.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_fi"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"fi.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_fr"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"fr.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
},
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"text_es"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"properties"</span> : {
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"es.utf-8"</span>,
<span class="hljs-string">"case"</span> : <span class="hljs-string">"lower"</span>,
<span class="hljs-string">"stopwords"</span> : [ ],
<span class="hljs-string">"accent"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"stemming"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"features"</span> : [
<span class="hljs-string">"position"</span>,
<span class="hljs-string">"norm"</span>,
<span class="hljs-string">"frequency"</span>
]
}
]
}
</pre>
<div id="RestAnalyzersGet_container_collapse" onclick="$('#RestAnalyzersGet_long').hide(); $('#RestAnalyzersGet_short').show(); window.location.hash='RestAnalyzersGet_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAnalyzersGet_short" onclick="$('#RestAnalyzersGet_short').hide(); $('#RestAnalyzersGet_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Analyzers/delete_api_analyzer.md -->
@startDocuBlock delete_api_analyzer
@brief removes an analyzer configuration
@RESTHEADER{DELETE /_api/analyzer/{analyzer-name}, Remove an analyzer, RestAnalyzerHandler:Delete}
@RESTURLPARAMETERS
@RESTURLPARAM{analyzer-name,string,required}
The name of the analyzer to remove.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{force,boolean,optional}
The analyzer configuration should be removed even if it is in-use.
The default value is *false*.
@RESTDESCRIPTION
Removes an analyzer configuration identified by *analyzer-name*.
If the analyzer definition was successfully dropped, an object is returned with
the following attributes:
- *error*: *false*
- *name*: The name of the removed analyzer
@RESTRETURNCODES
@RESTRETURNCODE{200}
The analyzer configuration was removed successfully.
@RESTRETURNCODE{400}
The *analyzer-name* was not supplied or another request parameter was not
valid.
@RESTRETURNCODE{403}
The user does not have permission to remove this analyzer configuration.
@RESTRETURNCODE{404}
Such an analyzer configuration does not exist.
@RESTRETURNCODE{409}
The specified analyzer configuration is still in use and *force* was omitted or
*false* specified.
@EXAMPLES
Removing without *force*:
<div class="example-container" id="RestAnalyzerDelete_container">
<a class="anchorjs-link " href="#RestAnalyzerDelete_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAnalyzerDelete_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>
}
</pre>
<div id="RestAnalyzerDelete_container_collapse" onclick="$('#RestAnalyzerDelete_long').hide(); $('#RestAnalyzerDelete_short').show(); window.location.hash='RestAnalyzerDelete_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAnalyzerDelete_short" onclick="$('#RestAnalyzerDelete_short').hide(); $('#RestAnalyzerDelete_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Removing with *force*:
<div class="example-container" id="RestAnalyzerDeleteForce_container">
<a class="anchorjs-link " href="#RestAnalyzerDeleteForce_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAnalyzerDeleteForce_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollection"</span>
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testView"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"links"</span> : {
<span class="hljs-string">"testCollection"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"testAnalyzer"</span>
]
}
}
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=<span class="hljs-literal">false</span></span>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>
}
</pre>
<div id="RestAnalyzerDeleteForce_container_collapse" onclick="$('#RestAnalyzerDeleteForce_long').hide(); $('#RestAnalyzerDeleteForce_short').show(); window.location.hash='RestAnalyzerDeleteForce_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAnalyzerDeleteForce_short" onclick="$('#RestAnalyzerDeleteForce_short').hide(); $('#RestAnalyzerDeleteForce_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/collection</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testCollection"</span>
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testView"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"links"</span> : {
<span class="hljs-string">"testCollection"</span> : {
<span class="hljs-string">"analyzers"</span> : [
<span class="hljs-string">"testAnalyzer"</span>
]
}
}
}
EOF
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=<span class="hljs-literal">false</span></span>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer?force=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Analyzers/post_api_analyzer.md -->
@startDocuBlock post_api_analyzer
@brief creates a new analyzer based on the provided definition
@RESTHEADER{POST /_api/analyzer, Create an analyzer with the suppiled definition, RestAnalyzerHandler:Create}
@RESTBODYPARAM{name,string,required,string}
The analyzer name.
@RESTBODYPARAM{type,string,required,string}
The analyzer type.
@RESTBODYPARAM{properties,string,optional,string}
The properties used to configure the specified type.
Value may be a string, an object or null.
The default value is *null*.
@RESTBODYPARAM{features,array,optional,string}
The set of features to set on the analyzer generated fields.
The default value is an empty array.
@RESTDESCRIPTION
Creates a new analyzer based on the provided configuration.
@RESTRETURNCODES
@RESTRETURNCODE{200}
An analyzer with a matching name and definition already exists.
@RESTRETURNCODE{201}
A new analyzer definition was successfully created.
@RESTRETURNCODE{400}
One or more of the required parameters is missing or one or more of the parameters
is not valid.
@RESTRETURNCODE{403}
The user does not have permission to create and analyzer with this configuration.
@EXAMPLES
<div class="example-container" id="RestAnalyzerPost_container">
<a class="anchorjs-link " href="#RestAnalyzerPost_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAnalyzerPost_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/analyzer</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testAnalyzer"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>,
<span class="hljs-string">"properties"</span> : {
},
<span class="hljs-string">"features"</span> : [ ]
}
</pre>
<div id="RestAnalyzerPost_container_collapse" onclick="$('#RestAnalyzerPost_long').hide(); $('#RestAnalyzerPost_short').show(); window.location.hash='RestAnalyzerPost_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAnalyzerPost_short" onclick="$('#RestAnalyzerPost_short').hide(); $('#RestAnalyzerPost_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/analyzer</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testAnalyzer"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Analyzers/get_api_analyzer.md -->
@startDocuBlock get_api_analyzer
@brief returns an analyzer definition
@RESTHEADER{GET /_api/analyzer/{analyzer-name}, Return the analyzer definition, RestAnalyzerHandler:GetDefinition}
@RESTURLPARAMETERS
@RESTURLPARAM{analyzer-name,string,required}
The name of the analyzer to retrieve.
@RESTDESCRIPTION
Retrieves the full definition for the specified analyzer name.
The resulting object contains the following attributes:
- *name*: the analyzer name
- *type*: the analyzer type
- *properties*: the properties used to configure the specified type
- *features*: the set of features to set on the analyzer generated fields
@RESTRETURNCODES
@RESTRETURNCODE{200}
The analyzer definition was retrieved successfully.
@RESTRETURNCODE{404}
Such an analyzer configuration does not exist.
@EXAMPLES
Retrieve an analyzer definition:
<div class="example-container" id="RestAnalyzerGet_container">
<a class="anchorjs-link " href="#RestAnalyzerGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAnalyzerGet_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"identity"</span>,
<span class="hljs-string">"properties"</span> : {
},
<span class="hljs-string">"features"</span> : [ ],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_system::testAnalyzer"</span>
}
</pre>
<div id="RestAnalyzerGet_container_collapse" onclick="$('#RestAnalyzerGet_long').hide(); $('#RestAnalyzerGet_short').show(); window.location.hash='RestAnalyzerGet_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAnalyzerGet_short" onclick="$('#RestAnalyzerGet_short').hide(); $('#RestAnalyzerGet_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/analyzer/testAnalyzer</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/get_api_view_name.md -->
@startDocuBlock get_api_view_name
@brief returns a View
@RESTHEADER{GET /_api/view/{view-name}, Return information about a View, getViews:Properties}
@RESTURLPARAMETERS
@RESTURLPARAM{view-name,string,required}
The name of the View.
@RESTDESCRIPTION
The result is an object briefly describing the View with the following attributes:
- *id*: The identifier of the View
- *name*: The name of the View
- *type*: The type of the View as string
@RESTRETURNCODES
@RESTRETURNCODE{404}
If the *view-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Using an identifier:
<div class="example-container" id="RestViewGetViewIdentifierArangoSearch_container">
<a class="anchorjs-link " href="#RestViewGetViewIdentifierArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewGetViewIdentifierArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/72029</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testView"</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72029"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72029"</span>
}
</pre>
<div id="RestViewGetViewIdentifierArangoSearch_container_collapse" onclick="$('#RestViewGetViewIdentifierArangoSearch_long').hide(); $('#RestViewGetViewIdentifierArangoSearch_short').show(); window.location.hash='RestViewGetViewIdentifierArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewGetViewIdentifierArangoSearch_short" onclick="$('#RestViewGetViewIdentifierArangoSearch_short').hide(); $('#RestViewGetViewIdentifierArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/72029</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a name:
<div class="example-container" id="RestViewGetViewNameArangoSearch_container">
<a class="anchorjs-link " href="#RestViewGetViewNameArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewGetViewNameArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/testView</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testView"</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72033"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72033"</span>
}
</pre>
<div id="RestViewGetViewNameArangoSearch_container_collapse" onclick="$('#RestViewGetViewNameArangoSearch_long').hide(); $('#RestViewGetViewNameArangoSearch_short').show(); window.location.hash='RestViewGetViewNameArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewGetViewNameArangoSearch_short" onclick="$('#RestViewGetViewNameArangoSearch_short').hide(); $('#RestViewGetViewNameArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/testView</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/post_api_view_arangosearch.md -->
@startDocuBlock post_api_view_arangosearch
@brief creates an ArangoSearch View
@RESTHEADER{POST /_api/view#arangosearch, Create an ArangoSearch View, createView}
@RESTBODYPARAM{name,string,required,string}
The name of the View.
@RESTBODYPARAM{type,string,required,string}
The type of the View. Must be equal to *"arangosearch"*.
This option is immutable.
@RESTBODYPARAM{links,object,optional,}
Expects an object with the attribute keys being names of to be linked collections,
and the link properties as attribute values. See
[ArangoSearch View Link Properties](https://www.arangodb.com/docs/stable/arangosearch-views.html#link-properties)
for details.
@RESTBODYPARAM{primarySort,array,optional,object}
A primary sort order can be defined to enable an AQL optimization. If a query
iterates over all documents of a View, wants to sort them by attribute values
and the (left-most) fields to sort by as well as their sorting direction match
with the *primarySort* definition, then the `SORT` operation is optimized away.
This option is immutable.
Expects an array of objects, each specifying a field (attribute path) and a
sort direction (`"asc` for ascending, `"desc"` for descending):
`[ { "field": "attr", "direction": "asc"}, … ]`
@RESTBODYPARAM{cleanupIntervalStep,integer,optional,int64}
Wait at least this many commits between removing unused files in the
ArangoSearch data directory (default: 2, to disable use: 0).
For the case where the consolidation policies merge segments often (i.e. a lot
of commit+consolidate), a lower value will cause a lot of disk space to be
wasted.
For the case where the consolidation policies rarely merge segments (i.e. few
inserts/deletes), a higher value will impact performance without any added
benefits.<br/>
_Background:_
With every "commit" or "consolidate" operation a new state of the View
internal data-structures is created on disk.
Old states/snapshots are released once there are no longer any users
remaining.
However, the files for the released states/snapshots are left on disk, and
only removed by "cleanup" operation.
@RESTBODYPARAM{commitIntervalMsec,integer,optional,int64}
Wait at least this many milliseconds between committing View data store
changes and making documents visible to queries (default: 1000, to disable
use: 0).
For the case where there are a lot of inserts/updates, a lower value, until
commit, will cause the index not to account for them and memory usage would
continue to grow.
For the case where there are a few inserts/updates, a higher value will impact
performance and waste disk space for each commit call without any added
benefits.<br/>
_Background:_
For data retrieval ArangoSearch Views follow the concept of
"eventually-consistent", i.e. eventually all the data in ArangoDB will be
matched by corresponding query expressions.
The concept of ArangoSearch View "commit" operation is introduced to
control the upper-bound on the time until document addition/removals are
actually reflected by corresponding query expressions.
Once a "commit" operation is complete all documents added/removed prior to
the start of the "commit" operation will be reflected by queries invoked in
subsequent ArangoDB transactions, in-progress ArangoDB transactions will
still continue to return a repeatable-read state.
@RESTBODYPARAM{consolidationIntervalMsec,integer,optional,int64}
Wait at least this many milliseconds between applying 'consolidationPolicy' to
consolidate View data store and possibly release space on the filesystem
(default: 10000, to disable use: 0).
For the case where there are a lot of data modification operations, a higher
value could potentially have the data store consume more space and file handles.
For the case where there are a few data modification operations, a lower value
will impact performance due to no segment candidates available for
consolidation.<br/>
_Background:_
For data modification ArangoSearch Views follow the concept of a
"versioned data store". Thus old versions of data may be removed once there
are no longer any users of the old data. The frequency of the cleanup and
compaction operations are governed by 'consolidationIntervalMsec' and the
candidates for compaction are selected via 'consolidationPolicy'.
@RESTBODYPARAM{consolidationPolicy,object,optional,}
The consolidation policy to apply for selecting which segments should be merged
(default: {})<br/>
_Background:_
With each ArangoDB transaction that inserts documents one or more
ArangoSearch internal segments gets created.
Similarly for removed documents the segments that contain such documents
will have these documents marked as 'deleted'.
Over time this approach causes a lot of small and sparse segments to be
created.
A "consolidation" operation selects one or more segments and copies all of
their valid documents into a single new segment, thereby allowing the
search algorithm to perform more optimally and for extra file handles to be
released once old segments are no longer used.<br/>
Sub-properties:
- `type` (string, _optional_):
The segment candidates for the "consolidation" operation are selected based
upon several possible configurable formulas as defined by their types.
The currently supported types are:
- `"tier"` (default): consolidate based on segment byte size and live
document count as dictated by the customization attributes. If this type
is used, then below `segments*` and `minScore` properties are available.
- `"bytes_accum"`: consolidate if and only if
`{threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes`
i.e. the sum of all candidate segment byte size is less than the total
segment byte size multiplied by the `{threshold}`. If this type is used,
then below `threshold` property is available.
- `threshold` (number, _optional_): value in the range `[0.0, 1.0]`
- `segmentsBytesFloor` (number, _optional_): Defines the value (in bytes) to
treat all smaller segments as equal for consolidation selection
(default: 2097152)
- `segmentsBytesMax` (number, _optional_): Maximum allowed size of all
consolidated segments in bytes (default: 5368709120)
- `segmentsMax` (number, _optional_): The maximum number of segments that will
be evaluated as candidates for consolidation (default: 10)
- `segmentsMin` (number, _optional_): The minimum number of segments that will
be evaluated as candidates for consolidation (default: 1)
- `minScore` (number, _optional_): (default: 0)
@RESTBODYPARAM{writebufferIdle,integer,optional,int64}
Maximum number of writers (segments) cached in the pool
(default: 64, use 0 to disable, immutable)
@RESTBODYPARAM{writebufferActive,integer,optional,int64}
Maximum number of concurrent active writers (segments) that perform a
transaction. Other writers (segments) wait till current active writers
(segments) finish (default: 0, use 0 to disable, immutable)
@RESTBODYPARAM{writebufferSizeMax,integer,optional,int64}
Maximum memory byte size per writer (segment) before a writer (segment) flush
is triggered. `0` value turns off this limit for any writer (buffer) and data
will be flushed periodically based on the value defined for the flush thread
(ArangoDB server startup option). `0` value should be used carefully due to
high potential memory consumption
(default: 33554432, use 0 to disable, immutable)
@RESTDESCRIPTION
Creates a new View with a given name and properties if it does not
already exist.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *name* or *type* attribute are missing or invalid, then an *HTTP 400*
error is returned.
@RESTRETURNCODE{409}
If a View called *name* already exists, then an *HTTP 409* error is returned.
@EXAMPLES
<div class="example-container" id="RestViewPostViewArangoSearch_container">
<a class="anchorjs-link " href="#RestViewPostViewArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewPostViewArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testViewBasics"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72052"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72052"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testViewBasics"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
</pre>
<div id="RestViewPostViewArangoSearch_container_collapse" onclick="$('#RestViewPostViewArangoSearch_long').hide(); $('#RestViewPostViewArangoSearch_short').show(); window.location.hash='RestViewPostViewArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewPostViewArangoSearch_short" onclick="$('#RestViewPostViewArangoSearch_short').hide(); $('#RestViewPostViewArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"testViewBasics"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/put_api_view_properties_arangosearch.md -->
@startDocuBlock put_api_view_properties_arangosearch
@brief changes all properties of an ArangoSearch View
@RESTHEADER{PUT /_api/view/{view-name}/properties#ArangoSearch, Change properties of an ArangoSearch View, modifyView}
@RESTURLPARAMETERS
@RESTURLPARAM{view-name,string,required}
The name of the View.
@RESTBODYPARAM{links,object,optional,}
Expects an object with the attribute keys being names of to be linked collections,
and the link properties as attribute values. See
[ArangoSearch View Link Properties](https://www.arangodb.com/docs/stable/arangosearch-views.html#link-properties)
for details.
@RESTBODYPARAM{cleanupIntervalStep,integer,optional,int64}
Wait at least this many commits between removing unused files in the
ArangoSearch data directory (default: 2, to disable use: 0).
For the case where the consolidation policies merge segments often (i.e. a lot
of commit+consolidate), a lower value will cause a lot of disk space to be
wasted.
For the case where the consolidation policies rarely merge segments (i.e. few
inserts/deletes), a higher value will impact performance without any added
benefits.<br/>
_Background:_
With every "commit" or "consolidate" operation a new state of the View
internal data-structures is created on disk.
Old states/snapshots are released once there are no longer any users
remaining.
However, the files for the released states/snapshots are left on disk, and
only removed by "cleanup" operation.
@RESTBODYPARAM{commitIntervalMsec,integer,optional,int64}
Wait at least this many milliseconds between committing View data store
changes and making documents visible to queries (default: 1000, to disable
use: 0).
For the case where there are a lot of inserts/updates, a lower value, until
commit, will cause the index not to account for them and memory usage would
continue to grow.
For the case where there are a few inserts/updates, a higher value will impact
performance and waste disk space for each commit call without any added
benefits.<br/>
_Background:_
For data retrieval ArangoSearch Views follow the concept of
"eventually-consistent", i.e. eventually all the data in ArangoDB will be
matched by corresponding query expressions.
The concept of ArangoSearch View "commit" operation is introduced to
control the upper-bound on the time until document addition/removals are
actually reflected by corresponding query expressions.
Once a "commit" operation is complete all documents added/removed prior to
the start of the "commit" operation will be reflected by queries invoked in
subsequent ArangoDB transactions, in-progress ArangoDB transactions will
still continue to return a repeatable-read state.
@RESTBODYPARAM{consolidationIntervalMsec,integer,optional,int64}
Wait at least this many milliseconds between applying 'consolidationPolicy' to
consolidate View data store and possibly release space on the filesystem
(default: 10000, to disable use: 0).
For the case where there are a lot of data modification operations, a higher
value could potentially have the data store consume more space and file handles.
For the case where there are a few data modification operations, a lower value
will impact performance due to no segment candidates available for
consolidation.<br/>
_Background:_
For data modification ArangoSearch Views follow the concept of a
"versioned data store". Thus old versions of data may be removed once there
are no longer any users of the old data. The frequency of the cleanup and
compaction operations are governed by 'consolidationIntervalMsec' and the
candidates for compaction are selected via 'consolidationPolicy'.
@RESTBODYPARAM{consolidationPolicy,object,optional,}
The consolidation policy to apply for selecting which segments should be merged
(default: {})<br/>
_Background:_
With each ArangoDB transaction that inserts documents one or more
ArangoSearch internal segments gets created.
Similarly for removed documents the segments that contain such documents
will have these documents marked as 'deleted'.
Over time this approach causes a lot of small and sparse segments to be
created.
A "consolidation" operation selects one or more segments and copies all of
their valid documents into a single new segment, thereby allowing the
search algorithm to perform more optimally and for extra file handles to be
released once old segments are no longer used.<br/>
Sub-properties:
- `type` (string, _optional_):
The segment candidates for the "consolidation" operation are selected based
upon several possible configurable formulas as defined by their types.
The currently supported types are:
- `"tier"` (default): consolidate based on segment byte size and live
document count as dictated by the customization attributes. If this type
is used, then below `segments*` and `minScore` properties are available.
- `"bytes_accum"`: consolidate if and only if
`{threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes`
i.e. the sum of all candidate segment byte size is less than the total
segment byte size multiplied by the `{threshold}`. If this type is used,
then below `threshold` property is available.
- `threshold` (number, _optional_): value in the range `[0.0, 1.0]`
- `segmentsBytesFloor` (number, _optional_): Defines the value (in bytes) to
treat all smaller segments as equal for consolidation selection
(default: 2097152)
- `segmentsBytesMax` (number, _optional_): Maximum allowed size of all
consolidated segments in bytes (default: 5368709120)
- `segmentsMax` (number, _optional_): The maximum number of segments that will
be evaluated as candidates for consolidation (default: 10)
- `segmentsMin` (number, _optional_): The minimum number of segments that will
be evaluated as candidates for consolidation (default: 1)
- `minScore` (number, _optional_): (default: 0)
@RESTDESCRIPTION
Changes the properties of a View by replacing them.
On success an object with the following attributes is returned:
- *id*: The identifier of the View
- *name*: The name of the View
- *type*: The View type
- all additional ArangoSearch View implementation specific properties
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *view-name* is missing, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *view-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
<div class="example-container" id="RestViewPutPropertiesArangoSearch_container">
<a class="anchorjs-link " href="#RestViewPutPropertiesArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewPutPropertiesArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view/products/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"en"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72056"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72056"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
</pre>
<div id="RestViewPutPropertiesArangoSearch_container_collapse" onclick="$('#RestViewPutPropertiesArangoSearch_long').hide(); $('#RestViewPutPropertiesArangoSearch_short').show(); window.location.hash='RestViewPutPropertiesArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewPutPropertiesArangoSearch_short" onclick="$('#RestViewPutPropertiesArangoSearch_short').hide(); $('#RestViewPutPropertiesArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view/products/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"en"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/patch_api_view_properties_arangosearch.md -->
@startDocuBlock patch_api_view_properties_arangosearch
@brief partially changes properties of an ArangoSearch View
@RESTHEADER{PATCH /_api/view/{view-name}/properties#ArangoSearch, Partially changes properties of an ArangoSearch View, modifyView}
@RESTURLPARAMETERS
@RESTURLPARAM{view-name,string,required}
The name of the View.
@RESTBODYPARAM{links,object,optional,}
Expects an object with the attribute keys being names of to be linked collections,
and the link properties as attribute values. See
[ArangoSearch View Link Properties](https://www.arangodb.com/docs/stable/arangosearch-views.html#link-properties)
for details.
@RESTBODYPARAM{cleanupIntervalStep,integer,optional,int64}
Wait at least this many commits between removing unused files in the
ArangoSearch data directory (default: 2, to disable use: 0).
For the case where the consolidation policies merge segments often (i.e. a lot
of commit+consolidate), a lower value will cause a lot of disk space to be
wasted.
For the case where the consolidation policies rarely merge segments (i.e. few
inserts/deletes), a higher value will impact performance without any added
benefits.<br/>
_Background:_
With every "commit" or "consolidate" operation a new state of the View
internal data-structures is created on disk.
Old states/snapshots are released once there are no longer any users
remaining.
However, the files for the released states/snapshots are left on disk, and
only removed by "cleanup" operation.
@RESTBODYPARAM{commitIntervalMsec,integer,optional,int64}
Wait at least this many milliseconds between committing View data store
changes and making documents visible to queries (default: 1000, to disable
use: 0).
For the case where there are a lot of inserts/updates, a lower value, until
commit, will cause the index not to account for them and memory usage would
continue to grow.
For the case where there are a few inserts/updates, a higher value will impact
performance and waste disk space for each commit call without any added
benefits.<br/>
_Background:_
For data retrieval ArangoSearch Views follow the concept of
"eventually-consistent", i.e. eventually all the data in ArangoDB will be
matched by corresponding query expressions.
The concept of ArangoSearch View "commit" operation is introduced to
control the upper-bound on the time until document addition/removals are
actually reflected by corresponding query expressions.
Once a "commit" operation is complete all documents added/removed prior to
the start of the "commit" operation will be reflected by queries invoked in
subsequent ArangoDB transactions, in-progress ArangoDB transactions will
still continue to return a repeatable-read state.
@RESTBODYPARAM{consolidationIntervalMsec,integer,optional,int64}
Wait at least this many milliseconds between applying 'consolidationPolicy' to
consolidate View data store and possibly release space on the filesystem
(default: 10000, to disable use: 0).
For the case where there are a lot of data modification operations, a higher
value could potentially have the data store consume more space and file handles.
For the case where there are a few data modification operations, a lower value
will impact performance due to no segment candidates available for
consolidation.<br/>
_Background:_
For data modification ArangoSearch Views follow the concept of a
"versioned data store". Thus old versions of data may be removed once there
are no longer any users of the old data. The frequency of the cleanup and
compaction operations are governed by 'consolidationIntervalMsec' and the
candidates for compaction are selected via 'consolidationPolicy'.
@RESTBODYPARAM{consolidationPolicy,object,optional,}
The consolidation policy to apply for selecting which segments should be merged
(default: {})<br/>
_Background:_
With each ArangoDB transaction that inserts documents one or more
ArangoSearch internal segments gets created.
Similarly for removed documents the segments that contain such documents
will have these documents marked as 'deleted'.
Over time this approach causes a lot of small and sparse segments to be
created.
A "consolidation" operation selects one or more segments and copies all of
their valid documents into a single new segment, thereby allowing the
search algorithm to perform more optimally and for extra file handles to be
released once old segments are no longer used.<br/>
Sub-properties:
- `type` (string, _optional_):
The segment candidates for the "consolidation" operation are selected based
upon several possible configurable formulas as defined by their types.
The currently supported types are:
- `"tier"` (default): consolidate based on segment byte size and live
document count as dictated by the customization attributes. If this type
is used, then below `segments*` and `minScore` properties are available.
- `"bytes_accum"`: consolidate if and only if
`{threshold} > (segment_bytes + sum_of_merge_candidate_segment_bytes) / all_segment_bytes`
i.e. the sum of all candidate segment byte size is less than the total
segment byte size multiplied by the `{threshold}`. If this type is used,
then below `threshold` property is available.
- `threshold` (number, _optional_): value in the range `[0.0, 1.0]`
- `segmentsBytesFloor` (number, _optional_): Defines the value (in bytes) to
treat all smaller segments as equal for consolidation selection
(default: 2097152)
- `segmentsBytesMax` (number, _optional_): Maximum allowed size of all
consolidated segments in bytes (default: 5368709120)
- `segmentsMax` (number, _optional_): The maximum number of segments that will
be evaluated as candidates for consolidation (default: 10)
- `segmentsMin` (number, _optional_): The minimum number of segments that will
be evaluated as candidates for consolidation (default: 1)
- `minScore` (number, _optional_): (default: 0)
@RESTDESCRIPTION
Changes the properties of a View by updating the specified attributes.
On success an object with the following attributes is returned:
- *id*: The identifier of the View
- *name*: The name of the View
- *type*: The View type
- all additional ArangoSearch View implementation specific properties
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *view-name* is missing, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *view-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
<div class="example-container" id="RestViewPatchPropertiesArangoSearch_container">
<a class="anchorjs-link " href="#RestViewPatchPropertiesArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewPatchPropertiesArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view/products/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"en"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72047"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72047"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
</pre>
<div id="RestViewPatchPropertiesArangoSearch_container_collapse" onclick="$('#RestViewPatchPropertiesArangoSearch_long').hide(); $('#RestViewPatchPropertiesArangoSearch_short').show(); window.location.hash='RestViewPatchPropertiesArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewPatchPropertiesArangoSearch_short" onclick="$('#RestViewPatchPropertiesArangoSearch_short').hide(); $('#RestViewPatchPropertiesArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view/products/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"locale"</span> : <span class="hljs-string">"en"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/delete_api_view.md -->
@startDocuBlock delete_api_view
@brief drops a View
@RESTHEADER{DELETE /_api/view/{view-name}, Drops a View, deleteView}
@RESTURLPARAMETERS
@RESTURLPARAM{view-name,string,required}
The name of the View to drop.
@RESTDESCRIPTION
Drops the View identified by *view-name*.
If the view was successfully dropped, an object is returned with
the following attributes:
- *error*: *false*
- *id*: The identifier of the dropped View
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *view-name* is missing, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *view-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Using an identifier:
<div class="example-container" id="RestViewDeleteViewIdentifierArangoSearch_container">
<a class="anchorjs-link " href="#RestViewDeleteViewIdentifierArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewDeleteViewIdentifierArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/72021</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestViewDeleteViewIdentifierArangoSearch_container_collapse" onclick="$('#RestViewDeleteViewIdentifierArangoSearch_long').hide(); $('#RestViewDeleteViewIdentifierArangoSearch_short').show(); window.location.hash='RestViewDeleteViewIdentifierArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewDeleteViewIdentifierArangoSearch_short" onclick="$('#RestViewDeleteViewIdentifierArangoSearch_short').hide(); $('#RestViewDeleteViewIdentifierArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/72021</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a name:
<div class="example-container" id="RestViewDeleteViewNameArangoSearch_container">
<a class="anchorjs-link " href="#RestViewDeleteViewNameArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewDeleteViewNameArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/testView</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestViewDeleteViewNameArangoSearch_container_collapse" onclick="$('#RestViewDeleteViewNameArangoSearch_long').hide(); $('#RestViewDeleteViewNameArangoSearch_short').show(); window.location.hash='RestViewDeleteViewNameArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewDeleteViewNameArangoSearch_short" onclick="$('#RestViewDeleteViewNameArangoSearch_short').hide(); $('#RestViewDeleteViewNameArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/testView</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/get_api_views.md -->
@startDocuBlock get_api_views
@brief returns all Views
@RESTHEADER{GET /_api/view, List all Views, getViews:AllViews}
@RESTDESCRIPTION
Returns an object containing a listing of all Views in a database, regardless
of their type. It is an array of objects with the following attributes:
- *id*
- *name*
- *type*
@RESTRETURNCODES
@RESTRETURNCODE{200}
The list of Views
@EXAMPLES
Return information about all Views:
<div class="example-container" id="RestViewGetAllViews_container">
<a class="anchorjs-link " href="#RestViewGetAllViews_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewGetAllViews_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/112"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"112"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"demoView"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>
}
]
}
</pre>
<div id="RestViewGetAllViews_container_collapse" onclick="$('#RestViewGetAllViews_long').hide(); $('#RestViewGetAllViews_short').show(); window.location.hash='RestViewGetAllViews_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewGetAllViews_short" onclick="$('#RestViewGetAllViews_short').hide(); $('#RestViewGetAllViews_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/get_api_view_properties.md -->
@startDocuBlock get_api_view_properties
@brief reads the properties of the specified View
@RESTHEADER{GET /_api/view/{view-name}/properties, Read properties of a View, getView}
@RESTURLPARAMETERS
@RESTDESCRIPTION
Returns an object containing the definition of the view identified by *view-name*.
@RESTURLPARAM{view-name,string,required}
The name of the View.
@RESTDESCRIPTION
The result is an object with a full description of a specific View, including
View type dependent properties.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *view-name* is missing, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *view-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
Using an identifier:
<div class="example-container" id="RestViewGetViewPropertiesIdentifierArangoSearch_container">
<a class="anchorjs-link " href="#RestViewGetViewPropertiesIdentifierArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewGetViewPropertiesIdentifierArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/72037/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72037"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72037"</span>,
<span class="hljs-string">"links"</span> : {
},
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>
}
</pre>
<div id="RestViewGetViewPropertiesIdentifierArangoSearch_container_collapse" onclick="$('#RestViewGetViewPropertiesIdentifierArangoSearch_long').hide(); $('#RestViewGetViewPropertiesIdentifierArangoSearch_short').show(); window.location.hash='RestViewGetViewPropertiesIdentifierArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewGetViewPropertiesIdentifierArangoSearch_short" onclick="$('#RestViewGetViewPropertiesIdentifierArangoSearch_short').hide(); $('#RestViewGetViewPropertiesIdentifierArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/72037/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a name:
<div class="example-container" id="RestViewGetViewPropertiesNameArangoSearch_container">
<a class="anchorjs-link " href="#RestViewGetViewPropertiesNameArangoSearch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewGetViewPropertiesNameArangoSearch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/products/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72042"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72042"</span>,
<span class="hljs-string">"links"</span> : {
},
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>
}
</pre>
<div id="RestViewGetViewPropertiesNameArangoSearch_container_collapse" onclick="$('#RestViewGetViewPropertiesNameArangoSearch_long').hide(); $('#RestViewGetViewPropertiesNameArangoSearch_short').show(); window.location.hash='RestViewGetViewPropertiesNameArangoSearch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewGetViewPropertiesNameArangoSearch_short" onclick="$('#RestViewGetViewPropertiesNameArangoSearch_short').hide(); $('#RestViewGetViewPropertiesNameArangoSearch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/view/products/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Views/put_api_view_rename.md -->
@startDocuBlock put_api_view_rename
@brief renames a View
@RESTHEADER{PUT /_api/view/{view-name}/rename, Rename a View, modifyView:rename}
@RESTURLPARAMETERS
@RESTURLPARAM{view-name,string,required}
The name of the View to rename.
@RESTDESCRIPTION
Renames a View. Expects an object with the attribute(s)
- *name*: The new name
It returns an object with the attributes
- *id*: The identifier of the View.
- *name*: The new name of the View.
- *type*: The View type.
**Note**: This method is not available in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{400}
If the *view-name* is missing, then a *HTTP 400* is returned.
@RESTRETURNCODE{404}
If the *view-name* is unknown, then a *HTTP 404* is returned.
@EXAMPLES
<div class="example-container" id="RestViewPutRename_container">
<a class="anchorjs-link " href="#RestViewPutRename_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestViewPutRename_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view/products1/rename</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"viewNewName"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"viewNewName"</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"h34D5FCD00B2F/72061"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"72061"</span>
}
</pre>
<div id="RestViewPutRename_container_collapse" onclick="$('#RestViewPutRename_long').hide(); $('#RestViewPutRename_short').show(); window.location.hash='RestViewPutRename_container';" class="example_show_button">Hide response body</div></div>
<div id="RestViewPutRename_short" onclick="$('#RestViewPutRename_short').hide(); $('#RestViewPutRename_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/view/products1/rename</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"viewNewName"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph Traversal/HTTP_API_TRAVERSAL.md -->
@startDocuBlock HTTP_API_TRAVERSAL
@brief execute a server-side traversal
@RESTHEADER{POST /_api/traversal,executes a traversal}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
It is considered as deprecated from version 3.4.0 on.
It is superseded by AQL graph traversal.
{% endhint %}
@RESTDESCRIPTION
Starts a traversal starting from a given vertex and following.
edges contained in a given edgeCollection. The request must
contain the following attributes.
@RESTBODYPARAM{startVertex,string,required,string}
id of the startVertex, e.g. *"users/foo"*.
@RESTBODYPARAM{edgeCollection,string,optional, string}
name of the collection that contains the edges.
@RESTBODYPARAM{graphName,string,optional,string}
name of the graph that contains the edges.
Either *edgeCollection* or *graphName* has to be given.
In case both values are set the *graphName* is preferred.
@RESTBODYPARAM{filter,string,optional,string}
default is to include all nodes:
body (JavaScript code) of custom filter function
function signature: *(config, vertex, path) -> mixed*
can return four different string values:
- *"exclude"* -> this vertex will not be visited.
- *"prune"* -> the edges of this vertex will not be followed.
- *""* or *undefined* -> visit the vertex and follow its edges.
- *Array* -> containing any combination of the above.
If there is at least one *"exclude"* or *"prune"* respectively
is contained, it's effect will occur.
@RESTBODYPARAM{minDepth,string,optional,string}
ANDed with any existing filters):
visits only nodes in at least the given depth
@RESTBODYPARAM{maxDepth,string,optional,string}
ANDed with any existing filters visits only nodes in at most the given depth
@RESTBODYPARAM{visitor,string,optional,string}
body (JavaScript) code of custom visitor function
function signature: *(config, result, vertex, path, connected) -> void*
The visitor function can do anything, but its return value is ignored. To
populate a result, use the *result* variable by reference. Note that the
*connected* argument is only populated when the *order* attribute is set
to *"preorder-expander"*.
@RESTBODYPARAM{direction,string,optional,string}
direction for traversal
- *if set*, must be either *"outbound"*, *"inbound"*, or *"any"*
- *if not set*, the *expander* attribute must be specified
@RESTBODYPARAM{init,string,optional,string}
body (JavaScript) code of custom result initialization function
function signature: *(config, result) -> void*
initialize any values in result with what is required
@RESTBODYPARAM{expander,string,optional,string}
body (JavaScript) code of custom expander function
*must* be set if *direction* attribute is **not** set
function signature: *(config, vertex, path) -> array*
expander must return an array of the connections for *vertex*
each connection is an object with the attributes *edge* and *vertex*
@RESTBODYPARAM{sort,string,optional,string}
body (JavaScript) code of a custom comparison function
for the edges. The signature of this function is
*(l, r) -> integer* (where l and r are edges) and must
return -1 if l is smaller than, +1 if l is greater than,
and 0 if l and r are equal. The reason for this is the
following: The order of edges returned for a certain
vertex is undefined. This is because there is no natural
order of edges for a vertex with multiple connected edges.
To explicitly define the order in which edges on the
vertex are followed, you can specify an edge comparator
function with this attribute. Note that the value here has
to be a string to conform to the JSON standard, which in
turn is parsed as function body on the server side. Furthermore
note that this attribute is only used for the standard
expanders. If you use your custom expander you have to
do the sorting yourself within the expander code.
@RESTBODYPARAM{strategy,string,optional,string}
traversal strategy can be *"depthfirst"* or *"breadthfirst"*
@RESTBODYPARAM{order,string,optional,string}
traversal order can be *"preorder"*, *"postorder"* or *"preorder-expander"*
@RESTBODYPARAM{itemOrder,string,optional,string}
item iteration order can be *"forward"* or *"backward"*
@RESTBODYPARAM{uniqueness,string,optional,string}
specifies uniqueness for vertices and edges visited.
If set, must be an object like this:
`"uniqueness": {"vertices": "none"|"global"|"path", "edges": "none"|"global"|"path"}`
@RESTBODYPARAM{maxIterations,string,optional,string}
Maximum number of iterations in each traversal. This number can be
set to prevent endless loops in traversal of cyclic graphs. When a traversal performs
as many iterations as the *maxIterations* value, the traversal will abort with an
error. If *maxIterations* is not set, a server-defined value may be used.
@RESTDESCRIPTION
If the Traversal is successfully executed *HTTP 200* will be returned.
Additionally the *result* object will be returned by the traversal.
For successful traversals, the returned JSON object has the
following properties:
- *error*: boolean flag to indicate if an error occurred (*false*
in this case)
- *code*: the HTTP status code
- *result*: the return value of the traversal
If the traversal specification is either missing or malformed, the server
will respond with *HTTP 400*.
The body of the response will then contain a JSON object with additional error
details. The object has the following attributes:
- *error*: boolean flag to indicate that an error occurred (*true* in this case)
- *code*: the HTTP status code
- *errorNum*: the server error number
- *errorMessage*: a descriptive error message
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the traversal is fully executed
*HTTP 200* will be returned.
@RESTRETURNCODE{400}
If the traversal specification is either missing or malformed, the server
will respond with *HTTP 400*.
@RESTRETURNCODE{404}
The server will responded with *HTTP 404* if the specified edge collection
does not exist, or the specified start vertex cannot be found.
@RESTRETURNCODE{500}
The server will responded with *HTTP 500* when an error occurs inside the
traversal or if a traversal performs more than *maxIterations* iterations.
@EXAMPLES
In the following examples the underlying graph will contain five persons
*Alice*, *Bob*, *Charlie*, *Dave* and *Eve*.
We will have the following directed relations:
- *Alice* knows *Bob*
- *Bob* knows *Charlie*
- *Bob* knows *Dave*
- *Eve* knows *Alice*
- *Eve* knows *Bob*
The starting vertex will always be Alice.
Follow only outbound edges
<div class="example-container" id="RestTraversalOutbound_container">
<a class="anchorjs-link " href="#RestTraversalOutbound_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalOutbound_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71770"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71770"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71770"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71770"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71772"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71772"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXS---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71770"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71770"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71774"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71774"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXS--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aXO--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalOutbound_container_collapse" onclick="$('#RestTraversalOutbound_long').hide(); $('#RestTraversalOutbound_short').show(); window.location.hash='RestTraversalOutbound_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalOutbound_short" onclick="$('#RestTraversalOutbound_short').hide(); $('#RestTraversalOutbound_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Follow only inbound edges
<div class="example-container" id="RestTraversalInbound_container">
<a class="anchorjs-link " href="#RestTraversalInbound_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalInbound_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"inbound"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aN6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aN6--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aN6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71576"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71576"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aO---E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aN6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aN6--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalInbound_container_collapse" onclick="$('#RestTraversalInbound_long').hide(); $('#RestTraversalInbound_short').show(); window.location.hash='RestTraversalInbound_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalInbound_short" onclick="$('#RestTraversalInbound_short').hide(); $('#RestTraversalInbound_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"inbound"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Follow any direction of edges
<div class="example-container" id="RestTraversalAny_container">
<a class="anchorjs-link " href="#RestTraversalAny_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalAny_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"uniqueness"</span> : {
<span class="hljs-string">"vertices"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"edges"</span> : <span class="hljs-string">"global"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71213"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71213"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71213"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71213"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71215"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71215"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGW---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71213"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71213"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71217"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71217"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGW--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71213"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71213"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71221"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71221"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGW--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71213"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71213"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71221"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71221"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGW--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71219"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71219"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGW--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGS--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aGO---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalAny_container_collapse" onclick="$('#RestTraversalAny_long').hide(); $('#RestTraversalAny_short').show(); window.location.hash='RestTraversalAny_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalAny_short" onclick="$('#RestTraversalAny_short').hide(); $('#RestTraversalAny_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"uniqueness"</span> : {
<span class="hljs-string">"vertices"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"edges"</span> : <span class="hljs-string">"global"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Excluding *Charlie* and *Bob*
<div class="example-container" id="RestTraversalFilterExclude_container">
<a class="anchorjs-link " href="#RestTraversalFilterExclude_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalFilterExclude_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"filter"</span> : <span class="hljs-string">"if (vertex.name === \"Bob\" || vertex.name === \"Charlie\") { return \"exclude\";}return;"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMW--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71479"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71479"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMW--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71483"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71483"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMa--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aMW--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalFilterExclude_container_collapse" onclick="$('#RestTraversalFilterExclude_long').hide(); $('#RestTraversalFilterExclude_short').show(); window.location.hash='RestTraversalFilterExclude_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalFilterExclude_short" onclick="$('#RestTraversalFilterExclude_short').hide(); $('#RestTraversalFilterExclude_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"filter"</span> : <span class="hljs-string">"if (vertex.name === \"Bob\" || vertex.name === \"Charlie\") { return \"exclude\";}return;"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Do not follow edges from *Bob*
<div class="example-container" id="RestTraversalFilterPrune_container">
<a class="anchorjs-link " href="#RestTraversalFilterPrune_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalFilterPrune_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"filter"</span> : <span class="hljs-string">"if (vertex.name === \"Bob\") {return \"prune\";}return;"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aNG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aNK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aNG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71527"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71527"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aNK--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aNG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aNK---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalFilterPrune_container_collapse" onclick="$('#RestTraversalFilterPrune_long').hide(); $('#RestTraversalFilterPrune_short').show(); window.location.hash='RestTraversalFilterPrune_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalFilterPrune_short" onclick="$('#RestTraversalFilterPrune_short').hide(); $('#RestTraversalFilterPrune_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"filter"</span> : <span class="hljs-string">"if (vertex.name === \"Bob\") {return \"prune\";}return;"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Visit only nodes in a depth of at least 2
<div class="example-container" id="RestTraversalMinDepth_container">
<a class="anchorjs-link " href="#RestTraversalMinDepth_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalMinDepth_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"minDepth"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWa--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWa--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71722"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71722"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWe--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71724"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71724"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWe--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWW---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWa---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWa--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71722"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71722"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWe--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71726"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71726"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWe--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWW---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWa---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aWa--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalMinDepth_container_collapse" onclick="$('#RestTraversalMinDepth_long').hide(); $('#RestTraversalMinDepth_short').show(); window.location.hash='RestTraversalMinDepth_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalMinDepth_short" onclick="$('#RestTraversalMinDepth_short').hide(); $('#RestTraversalMinDepth_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"minDepth"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Visit only nodes in a depth of at most 1
<div class="example-container" id="RestTraversalMaxDepth_container">
<a class="anchorjs-link " href="#RestTraversalMaxDepth_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalMaxDepth_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"maxDepth"</span> : <span class="hljs-number">1</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aOm---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aOq---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aOm---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71614"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71614"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aOq--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aOm---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aOq---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalMaxDepth_container_collapse" onclick="$('#RestTraversalMaxDepth_long').hide(); $('#RestTraversalMaxDepth_short').show(); window.location.hash='RestTraversalMaxDepth_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalMaxDepth_short" onclick="$('#RestTraversalMaxDepth_short').hide(); $('#RestTraversalMaxDepth_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"maxDepth"</span> : <span class="hljs-number">1</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a visitor function to return vertex ids only
<div class="example-container" id="RestTraversalVisitorFunc_container">
<a class="anchorjs-link " href="#RestTraversalVisitorFunc_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalVisitorFunc_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"visitor"</span> : <span class="hljs-string">"result.visited.vertices.push(vertex._id);"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
<span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"persons/dave"</span>
],
<span class="hljs-string">"paths"</span> : [ ]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalVisitorFunc_container_collapse" onclick="$('#RestTraversalVisitorFunc_long').hide(); $('#RestTraversalVisitorFunc_short').show(); window.location.hash='RestTraversalVisitorFunc_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalVisitorFunc_short" onclick="$('#RestTraversalVisitorFunc_short').hide(); $('#RestTraversalVisitorFunc_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"visitor"</span> : <span class="hljs-string">"result.visited.vertices.push(vertex._id);"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Count all visited nodes and return a list of nodes only
<div class="example-container" id="RestTraversalVisitorCountAndList_container">
<a class="anchorjs-link " href="#RestTraversalVisitorCountAndList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalVisitorCountAndList_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"init"</span> : <span class="hljs-string">"result.visited = 0; result.myVertices = [ ];"</span>,
<span class="hljs-string">"visitor"</span> : <span class="hljs-string">"result.visited++; result.myVertices.push(vertex);"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"myVertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aZi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aZm---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aZm--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aZm--D"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalVisitorCountAndList_container_collapse" onclick="$('#RestTraversalVisitorCountAndList_long').hide(); $('#RestTraversalVisitorCountAndList_short').show(); window.location.hash='RestTraversalVisitorCountAndList_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalVisitorCountAndList_short" onclick="$('#RestTraversalVisitorCountAndList_short').hide(); $('#RestTraversalVisitorCountAndList_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"outbound"</span>,
<span class="hljs-string">"init"</span> : <span class="hljs-string">"result.visited = 0; result.myVertices = [ ];"</span>,
<span class="hljs-string">"visitor"</span> : <span class="hljs-string">"result.visited++; result.myVertices.push(vertex);"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Expand only inbound edges of *Alice* and outbound edges of *Eve*
<div class="example-container" id="RestTraversalVisitorExpander_container">
<a class="anchorjs-link " href="#RestTraversalVisitorExpander_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalVisitorExpander_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"expander"</span> : <span class="hljs-string">"var connections = [ ];if (vertex.name === \"Alice\") {config.datasource.getInEdges(vertex).forEach(function (e) {connections.push({ vertex: require(\"internal\").db._document(e._from), edge: e});});}if (vertex.name === \"Eve\") {config.datasource.getOutEdges(vertex).forEach(function (e) {connections.push({vertex: require(\"internal\").db._document(e._to), edge: e});});}return connections;"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaW--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaW---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71946"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71946"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaa--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaW--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71946"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71946"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaa--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71948"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71948"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaa--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaW--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aaW---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalVisitorExpander_container_collapse" onclick="$('#RestTraversalVisitorExpander_long').hide(); $('#RestTraversalVisitorExpander_short').show(); window.location.hash='RestTraversalVisitorExpander_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalVisitorExpander_short" onclick="$('#RestTraversalVisitorExpander_short').hide(); $('#RestTraversalVisitorExpander_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"expander"</span> : <span class="hljs-string">"var connections = [ ];if (vertex.name === \"Alice\") {config.datasource.getInEdges(vertex).forEach(function (e) {connections.push({ vertex: require(\"internal\").db._document(e._from), edge: e});});}if (vertex.name === \"Eve\") {config.datasource.getOutEdges(vertex).forEach(function (e) {connections.push({vertex: require(\"internal\").db._document(e._to), edge: e});});}return connections;"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Follow the *depthfirst* strategy
<div class="example-container" id="RestTraversalDepthFirst_container">
<a class="anchorjs-link " href="#RestTraversalDepthFirst_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalDepthFirst_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"strategy"</span> : <span class="hljs-string">"depthfirst"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71346"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71346"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71346"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71346"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71348"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71348"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71346"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71346"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71350"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71350"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71346"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71346"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71354"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71354"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71346"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71346"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71354"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71354"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71352"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71352"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71352"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71352"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71352"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71352"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71354"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71354"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71352"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71352"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71354"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71354"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71348"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71348"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71352"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71352"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71354"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71354"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71350"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71350"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71352"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71352"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71354"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71354"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJm--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71346"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71346"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJi--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aJe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalDepthFirst_container_collapse" onclick="$('#RestTraversalDepthFirst_long').hide(); $('#RestTraversalDepthFirst_short').show(); window.location.hash='RestTraversalDepthFirst_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalDepthFirst_short" onclick="$('#RestTraversalDepthFirst_short').hide(); $('#RestTraversalDepthFirst_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"strategy"</span> : <span class="hljs-string">"depthfirst"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using *postorder* ordering
<div class="example-container" id="RestTraversalPostorder_container">
<a class="anchorjs-link " href="#RestTraversalPostorder_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalPostorder_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"order"</span> : <span class="hljs-string">"postorder"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71820"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71820"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71822"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71822"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71820"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71820"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71822"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71822"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71818"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71818"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71826"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71826"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71824"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71824"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aYC---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalPostorder_container_collapse" onclick="$('#RestTraversalPostorder_long').hide(); $('#RestTraversalPostorder_short').show(); window.location.hash='RestTraversalPostorder_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalPostorder_short" onclick="$('#RestTraversalPostorder_short').hide(); $('#RestTraversalPostorder_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"order"</span> : <span class="hljs-string">"postorder"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using *backward* item-ordering:
<div class="example-container" id="RestTraversalBackwardItemOrder_container">
<a class="anchorjs-link " href="#RestTraversalBackwardItemOrder_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalBackwardItemOrder_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"itemOrder"</span> : <span class="hljs-string">"backward"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71278"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71278"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71278"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71278"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71280"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71280"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aI----"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71278"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71278"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71280"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71280"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aI----"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71272"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71272"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71278"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71278"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71280"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71280"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aI----"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71276"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71276"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71278"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71278"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71280"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71280"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aI----"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71274"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71274"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71272"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71272"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71272"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71272"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71280"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71280"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aI----"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71272"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71272"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71280"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71280"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aI----"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71278"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71278"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--G"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71272"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71272"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71276"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71276"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--E"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71272"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71272"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71274"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71274"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH6--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aHy---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aH2--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalBackwardItemOrder_container_collapse" onclick="$('#RestTraversalBackwardItemOrder_long').hide(); $('#RestTraversalBackwardItemOrder_short').show(); window.location.hash='RestTraversalBackwardItemOrder_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalBackwardItemOrder_short" onclick="$('#RestTraversalBackwardItemOrder_short').hide(); $('#RestTraversalBackwardItemOrder_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"itemOrder"</span> : <span class="hljs-string">"backward"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Edges should only be included once globally,
but nodes are included every time they are visited
<div class="example-container" id="RestTraversalEdgeUniqueness_container">
<a class="anchorjs-link " href="#RestTraversalEdgeUniqueness_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalEdgeUniqueness_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"uniqueness"</span> : {
<span class="hljs-string">"vertices"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"edges"</span> : <span class="hljs-string">"global"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"visited"</span> : {
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
],
<span class="hljs-string">"paths"</span> : [
{
<span class="hljs-string">"edges"</span> : [ ],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71420"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71420"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71420"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71420"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71422"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71422"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"charlie"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/charlie"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Charlie"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71420"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71420"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71424"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71424"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK--C"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"bob"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"dave"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/dave"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Dave"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71420"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71420"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71428"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71428"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLO--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
}
]
},
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71420"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71420"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLK---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71428"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71428"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLO--A"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71426"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"knows/71426"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLO---"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"eve"</span>
}
],
<span class="hljs-string">"vertices"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"bob"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Bob"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"eve"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/eve"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Eve"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aLG---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
]
}
]
}
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestTraversalEdgeUniqueness_container_collapse" onclick="$('#RestTraversalEdgeUniqueness_long').hide(); $('#RestTraversalEdgeUniqueness_short').show(); window.location.hash='RestTraversalEdgeUniqueness_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalEdgeUniqueness_short" onclick="$('#RestTraversalEdgeUniqueness_short').hide(); $('#RestTraversalEdgeUniqueness_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"uniqueness"</span> : {
<span class="hljs-string">"vertices"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"edges"</span> : <span class="hljs-string">"global"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
If the underlying graph is cyclic, *maxIterations* should be set
The underlying graph has two vertices *Alice* and *Bob*.
With the directed edges:
- *Alice* knows *Bob*
- *Bob* knows *Alice*
<div class="example-container" id="RestTraversalMaxIterations_container">
<a class="anchorjs-link " href="#RestTraversalMaxIterations_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTraversalMaxIterations_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"uniqueness"</span> : {
<span class="hljs-string">"vertices"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"edges"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"maxIterations"</span> : <span class="hljs-number">5</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Internal Server <span class="hljs-built_in">Error</span>
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">500</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1909</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"too many iterations - try increasing the value of 'maxIterations'"</span>
}
</pre>
<div id="RestTraversalMaxIterations_container_collapse" onclick="$('#RestTraversalMaxIterations_long').hide(); $('#RestTraversalMaxIterations_short').show(); window.location.hash='RestTraversalMaxIterations_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTraversalMaxIterations_short" onclick="$('#RestTraversalMaxIterations_short').hide(); $('#RestTraversalMaxIterations_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/traversal</span> &lt;&lt;EOF
{
<span class="hljs-string">"startVertex"</span> : <span class="hljs-string">"persons/alice"</span>,
<span class="hljs-string">"graphName"</span> : <span class="hljs-string">"knows_graph"</span>,
<span class="hljs-string">"direction"</span> : <span class="hljs-string">"any"</span>,
<span class="hljs-string">"uniqueness"</span> : {
<span class="hljs-string">"vertices"</span> : <span class="hljs-string">"none"</span>,
<span class="hljs-string">"edges"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"maxIterations"</span> : <span class="hljs-number">5</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Internal Server <span class="hljs-built_in">Error</span>
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/get_admin_wal_properties.md -->
@startDocuBlock get_admin_wal_properties
@brief fetch the current configuration.
@RESTHEADER{GET /_admin/wal/properties, Retrieves the configuration of the write-ahead log, RestWalHandler:properties:get}
@RESTDESCRIPTION
Retrieves the configuration of the write-ahead log. The result is a JSON
object with the following attributes:
- *allowOversizeEntries*: whether or not operations that are bigger than a
single logfile can be executed and stored
- *logfileSize*: the size of each write-ahead logfile
- *historicLogfiles*: the maximum number of historic logfiles to keep
- *reserveLogfiles*: the maximum number of reserve logfiles that ArangoDB
allocates in the background
- *syncInterval*: the interval for automatic synchronization of not-yet
synchronized write-ahead log data (in milliseconds)
- *throttleWait*: the maximum wait time that operations will wait before
they get aborted if case of write-throttling (in milliseconds)
- *throttleWhenPending*: the number of unprocessed garbage-collection
operations that, when reached, will activate write-throttling. A value of
*0* means that write-throttling will not be triggered.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/get_admin_wal_properties.md -->
@startDocuBlock get_admin_wal_properties
@brief fetch the current configuration.
@RESTHEADER{GET /_admin/wal/properties, Retrieves the configuration of the write-ahead log, RestWalHandler:properties:get}
@RESTDESCRIPTION
Retrieves the configuration of the write-ahead log. The result is a JSON
object with the following attributes:
- *allowOversizeEntries*: whether or not operations that are bigger than a
single logfile can be executed and stored
- *logfileSize*: the size of each write-ahead logfile
- *historicLogfiles*: the maximum number of historic logfiles to keep
- *reserveLogfiles*: the maximum number of reserve logfiles that ArangoDB
allocates in the background
- *syncInterval*: the interval for automatic synchronization of not-yet
synchronized write-ahead log data (in milliseconds)
- *throttleWait*: the maximum wait time that operations will wait before
they get aborted if case of write-throttling (in milliseconds)
- *throttleWhenPending*: the number of unprocessed garbage-collection
operations that, when reached, will activate write-throttling. A value of
*0* means that write-throttling will not be triggered.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
@EXAMPLES
<div class="example-container" id="RestWalPropertiesGet_mmfiles_container">
<a class="anchorjs-link " href="#RestWalPropertiesGet_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalPropertiesGet_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/wal/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"allowOversizeEntries"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"logfileSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"historicLogfiles"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"reserveLogfiles"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"syncInterval"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"throttleWait"</span> : <span class="hljs-number">15000</span>,
<span class="hljs-string">"throttleWhenPending"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestWalPropertiesGet_mmfiles_container_collapse" onclick="$('#RestWalPropertiesGet_mmfiles_long').hide(); $('#RestWalPropertiesGet_mmfiles_short').show(); window.location.hash='RestWalPropertiesGet_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalPropertiesGet_mmfiles_short" onclick="$('#RestWalPropertiesGet_mmfiles_short').hide(); $('#RestWalPropertiesGet_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/wal/properties</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/put_admin_wal_properties.md -->
@startDocuBlock put_admin_wal_properties
@brief configure parameters of the wal
@RESTHEADER{PUT /_admin/wal/properties, Configures the write-ahead log, RestWalHandler:properties}
@RESTDESCRIPTION
Configures the behavior of the write-ahead log. The body of the request
must be a JSON object with the following attributes:
- *allowOversizeEntries*: whether or not operations that are bigger than a
single logfile can be executed and stored
- *logfileSize*: the size of each write-ahead logfile
- *historicLogfiles*: the maximum number of historic logfiles to keep
- *reserveLogfiles*: the maximum number of reserve logfiles that ArangoDB
allocates in the background
- *throttleWait*: the maximum wait time that operations will wait before
they get aborted if case of write-throttling (in milliseconds)
- *throttleWhenPending*: the number of unprocessed garbage-collection
operations that, when reached, will activate write-throttling. A value of
*0* means that write-throttling will not be triggered.
Specifying any of the above attributes is optional. Not specified attributes
will be ignored and the configuration for them will not be modified.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/put_admin_wal_properties.md -->
@startDocuBlock put_admin_wal_properties
@brief configure parameters of the wal
@RESTHEADER{PUT /_admin/wal/properties, Configures the write-ahead log, RestWalHandler:properties}
@RESTDESCRIPTION
Configures the behavior of the write-ahead log. The body of the request
must be a JSON object with the following attributes:
- *allowOversizeEntries*: whether or not operations that are bigger than a
single logfile can be executed and stored
- *logfileSize*: the size of each write-ahead logfile
- *historicLogfiles*: the maximum number of historic logfiles to keep
- *reserveLogfiles*: the maximum number of reserve logfiles that ArangoDB
allocates in the background
- *throttleWait*: the maximum wait time that operations will wait before
they get aborted if case of write-throttling (in milliseconds)
- *throttleWhenPending*: the number of unprocessed garbage-collection
operations that, when reached, will activate write-throttling. A value of
*0* means that write-throttling will not be triggered.
Specifying any of the above attributes is optional. Not specified attributes
will be ignored and the configuration for them will not be modified.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
@EXAMPLES
<div class="example-container" id="RestWalPropertiesPut_mmfiles_container">
<a class="anchorjs-link " href="#RestWalPropertiesPut_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalPropertiesPut_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/wal/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"logfileSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"allowOversizeEntries"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"allowOversizeEntries"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"logfileSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"historicLogfiles"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"reserveLogfiles"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"syncInterval"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"throttleWait"</span> : <span class="hljs-number">15000</span>,
<span class="hljs-string">"throttleWhenPending"</span> : <span class="hljs-number">0</span>
}
</pre>
<div id="RestWalPropertiesPut_mmfiles_container_collapse" onclick="$('#RestWalPropertiesPut_mmfiles_long').hide(); $('#RestWalPropertiesPut_mmfiles_short').show(); window.location.hash='RestWalPropertiesPut_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalPropertiesPut_mmfiles_short" onclick="$('#RestWalPropertiesPut_mmfiles_short').hide(); $('#RestWalPropertiesPut_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_admin/wal/properties</span> &lt;&lt;EOF
{
<span class="hljs-string">"logfileSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"allowOversizeEntries"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/get_admin_wal_transactions.md -->
@startDocuBlock get_admin_wal_transactions
@brief returns information about the currently running transactions
@RESTHEADER{GET /_admin/wal/transactions, Returns information about the currently running transactions, RestWalHandler:transactions}
@RESTDESCRIPTION
Returns information about the currently running transactions. The result
is a JSON object with the following attributes:
- *runningTransactions*: number of currently running transactions
- *minLastCollected*: minimum id of the last collected logfile (at the
start of each running transaction). This is *null* if no transaction is
running.
- *minLastSealed*: minimum id of the last sealed logfile (at the
start of each running transaction). This is *null* if no transaction is
running.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/get_admin_wal_transactions.md -->
@startDocuBlock get_admin_wal_transactions
@brief returns information about the currently running transactions
@RESTHEADER{GET /_admin/wal/transactions, Returns information about the currently running transactions, RestWalHandler:transactions}
@RESTDESCRIPTION
Returns information about the currently running transactions. The result
is a JSON object with the following attributes:
- *runningTransactions*: number of currently running transactions
- *minLastCollected*: minimum id of the last collected logfile (at the
start of each running transaction). This is *null* if no transaction is
running.
- *minLastSealed*: minimum id of the last sealed logfile (at the
start of each running transaction). This is *null* if no transaction is
running.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
@EXAMPLES
<div class="example-container" id="RestWalTransactionsGet_mmfiles_container">
<a class="anchorjs-link " href="#RestWalTransactionsGet_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalTransactionsGet_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/wal/transactions</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"runningTransactions"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"minLastCollected"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"minLastSealed"</span> : <span class="hljs-literal">null</span>
}
</pre>
<div id="RestWalTransactionsGet_mmfiles_container_collapse" onclick="$('#RestWalTransactionsGet_mmfiles_long').hide(); $('#RestWalTransactionsGet_mmfiles_short').show(); window.location.hash='RestWalTransactionsGet_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalTransactionsGet_mmfiles_short" onclick="$('#RestWalTransactionsGet_mmfiles_short').hide(); $('#RestWalTransactionsGet_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_admin/wal/transactions</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/wal/put_admin_wal_flush.md -->
@startDocuBlock put_admin_wal_flush
@brief Sync the WAL to disk.
@RESTHEADER{PUT /_admin/wal/flush, Flushes the write-ahead log, RestWalHandler:flush}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Whether or not the operation should block until the not-yet synchronized
data in the write-ahead log was synchronized to disk.
@RESTQUERYPARAM{waitForCollector,boolean,optional}
Whether or not the operation should block until the data in the flushed
log has been collected by the write-ahead log garbage collector. Note that
setting this option to *true* might block for a long time if there are
long-running transactions and the write-ahead log garbage collector cannot
finish garbage collection.
@RESTDESCRIPTION
Flushes the write-ahead log. By flushing the currently active write-ahead
logfile, the data in it can be transferred to collection journals and
datafiles. This is useful to ensure that all data for a collection is
present in the collection journals and datafiles, for example, when dumping
the data of a collection.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the operation succeeds.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Transactions/get_api_transaction.md -->
@startDocuBlock get_api_transaction
@brief Fetch status of a server-side transaction
@RESTHEADER{GET /_api/transaction/{transaction-id}, Get transaction status, executeGetState:transaction}
@RESTURLPARAMETERS
@RESTURLPARAM{transaction-id,string,required}
The transaction identifier.
@RESTDESCRIPTION
The result is an object describing the status of the transaction.
It has at least the following attributes:
- *id*: the identifier of the transaction
- *status*: the status of the transaction. One of "running", "committed" or "aborted".
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the transaction is fully executed and committed on the server,
*HTTP 200* will be returned.
@RESTRETURNCODE{400}
If the transaction identifier specified is either missing or malformed, the server
will respond with *HTTP 400*.
@RESTRETURNCODE{404}
If the transaction was not found with the specified identifier, the server
will respond with *HTTP 404*.
@EXAMPLES
Get transaction status
<div class="example-container" id="RestTransactionGet_container">
<a class="anchorjs-link " href="#RestTransactionGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionGet_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction/71151</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"71151"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"running"</span>
}
}
</pre>
<div id="RestTransactionGet_container_collapse" onclick="$('#RestTransactionGet_long').hide(); $('#RestTransactionGet_short').show(); window.location.hash='RestTransactionGet_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionGet_short" onclick="$('#RestTransactionGet_short').hide(); $('#RestTransactionGet_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction/71151</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Transactions/put_api_transaction.md -->
@startDocuBlock put_api_transaction
@brief commit a server-side transaction
@RESTHEADER{PUT /_api/transaction/{transaction-id}, Commit transaction, executeCommit:Transaction}
@RESTURLPARAMETERS
@RESTURLPARAM{transaction-id,string,required}
The transaction identifier,
@RESTDESCRIPTION
Commit a running server-side transaction. Committing is an idempotent operation.
It is not an error to commit a transaction more than once.
If the transaction can be committed, *HTTP 200* will be returned.
The returned JSON object has the following properties:
- *error*: boolean flag to indicate if an error occurred (*false*
in this case)
- *code*: the HTTP status code
- *result*: result containing
- *id*: the identifier of the transaction
- *status*: containing the string 'committed'
If the transaction cannot be found, committing is not allowed or the
transaction was aborted, the server
will respond with *HTTP 400*, *HTTP 404* or *HTTP 409*.
The body of the response will then contain a JSON object with additional error
details. The object has the following attributes:
- *error*: boolean flag to indicate that an error occurred (*true* in this case)
- *code*: the HTTP status code
- *errorNum*: the server error number
- *errorMessage*: a descriptive error message
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the transaction was committed,
*HTTP 200* will be returned.
@RESTRETURNCODE{400}
If the transaction cannot be committed, the server
will respond with *HTTP 400*.
@RESTRETURNCODE{404}
If the transaction was not found, the server
will respond with *HTTP 404*.
@RESTRETURNCODE{409}
If the transaction was already aborted, the server
will respond with *HTTP 409*.
@EXAMPLES
Committing a transaction:
<div class="example-container" id="RestTransactionBeginAbort_container">
<a class="anchorjs-link " href="#RestTransactionBeginAbort_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionBeginAbort_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction/71125</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"71125"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"committed"</span>
}
}
</pre>
<div id="RestTransactionBeginAbort_container_collapse" onclick="$('#RestTransactionBeginAbort_long').hide(); $('#RestTransactionBeginAbort_short').show(); window.location.hash='RestTransactionBeginAbort_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionBeginAbort_short" onclick="$('#RestTransactionBeginAbort_short').hide(); $('#RestTransactionBeginAbort_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction/71125</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Transactions/post_api_transaction.md -->
@startDocuBlock post_api_transaction
@brief execute a server-side transaction
@RESTHEADER{POST /_api/transaction, Execute transaction, executeCommit}
@RESTBODYPARAM{collections,string,required,string}
*collections* must be a JSON object that can have one or all sub-attributes
*read*, *write* or *exclusive*, each being an array of collection names or a
single collection name as string. Collections that will be written to in the
transaction must be declared with the *write* or *exclusive* attribute or it
will fail, whereas non-declared collections from which is solely read will be
added lazily. The optional sub-attribute *allowImplicit* can be set to *false*
to let transactions fail in case of undeclared collections for reading.
Collections for reading should be fully declared if possible, to avoid
deadlocks.
See [locking and isolation](../../Manual/Transactions/LockingAndIsolation.html)
for more information.
@RESTBODYPARAM{action,string,required,string}
the actual transaction operations to be executed, in the
form of stringified JavaScript code. The code will be executed on server
side, with late binding. It is thus critical that the code specified in
*action* properly sets up all the variables it needs.
If the code specified in *action* ends with a return statement, the
value returned will also be returned by the REST API in the *result*
attribute if the transaction committed successfully.
@RESTBODYPARAM{waitForSync,boolean,optional,boolean}
an optional boolean flag that, if set, will force the
transaction to write all data to disk before returning.
@RESTBODYPARAM{allowImplicit,boolean,optional,boolean}
Allow reading from undeclared collections.
@RESTBODYPARAM{lockTimeout,integer,optional,int64}
an optional numeric value that can be used to set a
timeout for waiting on collection locks. If not specified, a default
value will be used. Setting *lockTimeout* to *0* will make ArangoDB
not time out waiting for a lock.
@RESTBODYPARAM{params,string,optional,string}
optional arguments passed to *action*.
@RESTBODYPARAM{maxTransactionSize,integer,optional,int64}
Transaction size limit in bytes. Honored by the RocksDB storage engine only.
@RESTDESCRIPTION
The transaction description must be passed in the body of the POST request.
If the transaction is fully executed and committed on the server,
*HTTP 200* will be returned. Additionally, the return value of the
code defined in *action* will be returned in the *result* attribute.
For successfully committed transactions, the returned JSON object has the
following properties:
- *error*: boolean flag to indicate if an error occurred (*false*
in this case)
- *code*: the HTTP status code
- *result*: the return value of the transaction
If the transaction specification is either missing or malformed, the server
will respond with *HTTP 400*.
The body of the response will then contain a JSON object with additional error
details. The object has the following attributes:
- *error*: boolean flag to indicate that an error occurred (*true* in this case)
- *code*: the HTTP status code
- *errorNum*: the server error number
- *errorMessage*: a descriptive error message
If a transaction fails to commit, either by an exception thrown in the
*action* code, or by an internal error, the server will respond with
an error.
Any other errors will be returned with any of the return codes
*HTTP 400*, *HTTP 409*, or *HTTP 500*.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the transaction is fully executed and committed on the server,
*HTTP 200* will be returned.
@RESTRETURNCODE{400}
If the transaction specification is either missing or malformed, the server
will respond with *HTTP 400*.
@RESTRETURNCODE{404}
If the transaction specification contains an unknown collection, the server
will respond with *HTTP 404*.
@RESTRETURNCODE{500}
Exceptions thrown by users will make the server respond with a return code of
*HTTP 500*
@EXAMPLES
Executing a transaction on a single collection
<div class="example-container" id="RestTransactionSingle_container">
<a class="anchorjs-link " href="#RestTransactionSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionSingle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () { var db = require('@arangodb').db; db.products.save({}); return db.products.count(); }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="RestTransactionSingle_container_collapse" onclick="$('#RestTransactionSingle_long').hide(); $('#RestTransactionSingle_short').show(); window.location.hash='RestTransactionSingle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionSingle_short" onclick="$('#RestTransactionSingle_short').hide(); $('#RestTransactionSingle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () { var db = require('@arangodb').db; db.products.save({}); return db.products.count(); }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Executing a transaction using multiple collections
<div class="example-container" id="RestTransactionMulti_container">
<a class="anchorjs-link " href="#RestTransactionMulti_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionMulti_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : [
<span class="hljs-string">"products"</span>,
<span class="hljs-string">"materials"</span>
]
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () {var db = require('@arangodb').db;db.products.save({});db.materials.save({});return 'worked!';}"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-string">"worked!"</span>
}
</pre>
<div id="RestTransactionMulti_container_collapse" onclick="$('#RestTransactionMulti_long').hide(); $('#RestTransactionMulti_short').show(); window.location.hash='RestTransactionMulti_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionMulti_short" onclick="$('#RestTransactionMulti_short').hide(); $('#RestTransactionMulti_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : [
<span class="hljs-string">"products"</span>,
<span class="hljs-string">"materials"</span>
]
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () {var db = require('@arangodb').db;db.products.save({});db.materials.save({});return 'worked!';}"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Aborting a transaction due to an internal error
<div class="example-container" id="RestTransactionAbortInternal_container">
<a class="anchorjs-link " href="#RestTransactionAbortInternal_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionAbortInternal_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () {var db = require('@arangodb').db;db.products.save({ _key: 'abc'});db.products.save({ _key: 'abc'});}"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Conflict
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">409</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"unique constraint violated - in index primary of type primary over '_key'; conflicting key: abc"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1210</span>
}
</pre>
<div id="RestTransactionAbortInternal_container_collapse" onclick="$('#RestTransactionAbortInternal_long').hide(); $('#RestTransactionAbortInternal_short').show(); window.location.hash='RestTransactionAbortInternal_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionAbortInternal_short" onclick="$('#RestTransactionAbortInternal_short').hide(); $('#RestTransactionAbortInternal_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () {var db = require('@arangodb').db;db.products.save({ _key: 'abc'});db.products.save({ _key: 'abc'});}"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Conflict
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Aborting a transaction by explicitly throwing an exception
<div class="example-container" id="RestTransactionAbort_container">
<a class="anchorjs-link " href="#RestTransactionAbort_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionAbort_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () { throw 'doh!'; }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Internal Server <span class="hljs-built_in">Error</span>
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">500</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"doh!"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1650</span>
}
</pre>
<div id="RestTransactionAbort_container_collapse" onclick="$('#RestTransactionAbort_long').hide(); $('#RestTransactionAbort_short').show(); window.location.hash='RestTransactionAbort_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionAbort_short" onclick="$('#RestTransactionAbort_short').hide(); $('#RestTransactionAbort_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () { throw 'doh!'; }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Internal Server <span class="hljs-built_in">Error</span>
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Referring to a non-existing collection
<div class="example-container" id="RestTransactionNonExisting_container">
<a class="anchorjs-link " href="#RestTransactionNonExisting_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionNonExisting_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () { return true; }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found: products"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestTransactionNonExisting_container_collapse" onclick="$('#RestTransactionNonExisting_long').hide(); $('#RestTransactionNonExisting_short').show(); window.location.hash='RestTransactionNonExisting_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionNonExisting_short" onclick="$('#RestTransactionNonExisting_short').hide(); $('#RestTransactionNonExisting_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-string">"products"</span>
},
<span class="hljs-string">"action"</span> : <span class="hljs-string">"function () { return true; }"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Transactions/get_api_transactions.md -->
@startDocuBlock get_api_transactions
@brief Return the currently running server-side transactions
@RESTHEADER{GET /_api/transaction, Get currently running transactions, executeGetState:transactions}
@RESTDESCRIPTION
The result is an object describing with the attribute *transactions*, which contains
an array of transactions.
In a cluster the array will contain the transactions from all coordinators.
Each array entry contains an object with the following attributes:
- *id*: the transaction's id
- *status*: the transaction's status
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the list of transactions can be retrieved successfully, *HTTP 200* will be returned.
@EXAMPLES
Get currently running transactions
<div class="example-container" id="RestTransactionsGet_container">
<a class="anchorjs-link " href="#RestTransactionsGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionsGet_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"transactions"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"71190"</span>,
<span class="hljs-string">"state"</span> : <span class="hljs-string">"running"</span>
}
]
}
</pre>
<div id="RestTransactionsGet_container_collapse" onclick="$('#RestTransactionsGet_long').hide(); $('#RestTransactionsGet_short').show(); window.location.hash='RestTransactionsGet_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionsGet_short" onclick="$('#RestTransactionsGet_short').hide(); $('#RestTransactionsGet_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Transactions/delete_api_transaction.md -->
@startDocuBlock delete_api_transaction
@brief abort a server-side transaction
@RESTHEADER{DELETE /_api/transaction/{transaction-id}, Abort transaction, executeAbort:transaction}
@RESTURLPARAMETERS
@RESTURLPARAM{transaction-id,string,required}
The transaction identifier,
@RESTDESCRIPTION
Abort a running server-side transaction. Aborting is an idempotent operation.
It is not an error to abort a transaction more than once.
If the transaction can be aborted, *HTTP 200* will be returned.
The returned JSON object has the following properties:
- *error*: boolean flag to indicate if an error occurred (*false*
in this case)
- *code*: the HTTP status code
- *result*: result containing
- *id*: the identifier of the transaction
- *status*: containing the string 'aborted'
If the transaction cannot be found, aborting is not allowed or the
transaction was already committed, the server
will respond with *HTTP 400*, *HTTP 404* or *HTTP 409*.
The body of the response will then contain a JSON object with additional error
details. The object has the following attributes:
- *error*: boolean flag to indicate that an error occurred (*true* in this case)
- *code*: the HTTP status code
- *errorNum*: the server error number
- *errorMessage*: a descriptive error message
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the transaction was aborted,
*HTTP 200* will be returned.
@RESTRETURNCODE{400}
If the transaction cannot be aborted, the server
will respond with *HTTP 400*.
@RESTRETURNCODE{404}
If the transaction was not found, the server
will respond with *HTTP 404*.
@RESTRETURNCODE{409}
If the transaction was already committed, the server
will respond with *HTTP 409*.
@EXAMPLES
Aborting a transaction:
<div class="example-container" id="RestTransactionBeginCommit_container">
<a class="anchorjs-link " href="#RestTransactionBeginCommit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionBeginCommit_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction/71133</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"71133"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"aborted"</span>
}
}
</pre>
<div id="RestTransactionBeginCommit_container_collapse" onclick="$('#RestTransactionBeginCommit_long').hide(); $('#RestTransactionBeginCommit_short').show(); window.location.hash='RestTransactionBeginCommit_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionBeginCommit_short" onclick="$('#RestTransactionBeginCommit_short').hide(); $('#RestTransactionBeginCommit_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/transaction/71133</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Transactions/post_api_transaction_begin.md -->
@startDocuBlock post_api_transaction_begin
@brief begin a server-side transaction
@RESTHEADER{POST /_api/transaction/begin, Begin transaction, executeBegin}
@RESTBODYPARAM{collections,string,required,string}
*collections* must be a JSON object that can have one or all sub-attributes
*read*, *write* or *exclusive*, each being an array of collection names or a
single collection name as string. Collections that will be written to in the
transaction must be declared with the *write* or *exclusive* attribute or it
will fail, whereas non-declared collections from which is solely read will be
added lazily. The optional sub-attribute *allowImplicit* can be set to *false*
to let transactions fail in case of undeclared collections for reading.
Collections for reading should be fully declared if possible, to avoid
deadlocks.
See [locking and isolation](../../Manual/Transactions/LockingAndIsolation.html)
for more information.
@RESTBODYPARAM{waitForSync,boolean,optional,boolean}
an optional boolean flag that, if set, will force the
transaction to write all data to disk before returning.
@RESTBODYPARAM{allowImplicit,boolean,optional,boolean}
Allow reading from undeclared collections.
@RESTBODYPARAM{lockTimeout,integer,optional,int64}
an optional numeric value that can be used to set a
timeout for waiting on collection locks. If not specified, a default
value will be used. Setting *lockTimeout* to *0* will make ArangoDB
not time out waiting for a lock.
@RESTBODYPARAM{maxTransactionSize,integer,optional,int64}
Transaction size limit in bytes. Honored by the RocksDB storage engine only.
@RESTDESCRIPTION
The transaction description must be passed in the body of the POST request.
If the transaction can be started on the server, *HTTP 201* will be returned.
For successfully started transactions, the returned JSON object has the
following properties:
- *error*: boolean flag to indicate if an error occurred (*false*
in this case)
- *code*: the HTTP status code
- *result*: result containing
- *id*: the identifier of the transaction
- *status*: containing the string 'running'
If the transaction specification is either missing or malformed, the server
will respond with *HTTP 400* or *HTTP 404*.
The body of the response will then contain a JSON object with additional error
details. The object has the following attributes:
- *error*: boolean flag to indicate that an error occurred (*true* in this case)
- *code*: the HTTP status code
- *errorNum*: the server error number
- *errorMessage*: a descriptive error message
@RESTRETURNCODES
@RESTRETURNCODE{201}
If the transaction is running on the server,
*HTTP 201* will be returned.
@RESTRETURNCODE{400}
If the transaction specification is either missing or malformed, the server
will respond with *HTTP 400*.
@RESTRETURNCODE{404}
If the transaction specification contains an unknown collection, the server
will respond with *HTTP 404*.
@EXAMPLES
Executing a transaction on a single collection
<div class="example-container" id="RestTransactionBeginSingle_container">
<a class="anchorjs-link " href="#RestTransactionBeginSingle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionBeginSingle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction/begin</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : <span class="hljs-string">"products"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"71143"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"running"</span>
}
}
</pre>
<div id="RestTransactionBeginSingle_container_collapse" onclick="$('#RestTransactionBeginSingle_long').hide(); $('#RestTransactionBeginSingle_short').show(); window.location.hash='RestTransactionBeginSingle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionBeginSingle_short" onclick="$('#RestTransactionBeginSingle_short').hide(); $('#RestTransactionBeginSingle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction/begin</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"write"</span> : <span class="hljs-string">"products"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Referring to a non-existing collection
<div class="example-container" id="RestTransactionBeginNonExisting_container">
<a class="anchorjs-link " href="#RestTransactionBeginNonExisting_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestTransactionBeginNonExisting_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction/begin</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-string">"products"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection or view not found:products"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1203</span>
}
</pre>
<div id="RestTransactionBeginNonExisting_container_collapse" onclick="$('#RestTransactionBeginNonExisting_long').hide(); $('#RestTransactionBeginNonExisting_short').show(); window.location.hash='RestTransactionBeginNonExisting_container';" class="example_show_button">Hide response body</div></div>
<div id="RestTransactionBeginNonExisting_short" onclick="$('#RestTransactionBeginNonExisting_short').hide(); $('#RestTransactionBeginNonExisting_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/transaction/begin</span> &lt;&lt;EOF
{
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-string">"products"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/RestRemoveByKeys.md -->
@startDocuBlock RestRemoveByKeys
@brief removes multiple documents by their keys
@RESTHEADER{PUT /_api/simple/remove-by-keys, Remove documents by their keys}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to look in for the documents to remove
@RESTBODYPARAM{keys,array,required,string}
array with the _keys of documents to remove.
@RESTBODYPARAM{options,object,optional,put_api_simple_remove_by_keys_opts}
a json object which can contains following attributes:
@RESTSTRUCT{waitForSync,put_api_simple_remove_by_keys_opts,boolean,optional,}
if set to true, then all removal operations will
instantly be synchronized to disk. If this is not specified, then the
collection's default sync behavior will be applied.
@RESTSTRUCT{silent,put_api_simple_remove_by_keys_opts,boolean,optional,}
if set to *false*, then the result will contain an additional
attribute *old* which contains an array with one entry for each
removed document. By default, these entries will have the *_id*,
*_key* and *_rev* attributes.
@RESTSTRUCT{returnOld,put_api_simple_remove_by_keys_opts,boolean,optional,}
if set to *true* and *silent* above is *false*, then the above
information about the removed documents contains the complete
removed documents.
@RESTDESCRIPTION
Looks up the documents in the specified collection using the array of keys
provided, and removes all documents from the collection whose keys are
contained in the *keys* array. Keys for which no document can be found in
the underlying collection are ignored, and no exception will be thrown for
them.
Equivalent AQL query (the RETURN clause is optional):
FOR key IN @keys REMOVE key IN @@collection
RETURN OLD
The body of the response contains a JSON object with information how many
documents were removed (and how many were not). The *removed* attribute will
contain the number of actually removed documents. The *ignored* attribute
will contain the number of keys in the request for which no matching document
could be found.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the operation was carried out successfully. The number of removed
documents may still be 0 in this case if none of the specified document keys
were found in the collection.
@RESTRETURNCODE{404}
is returned if the collection was not found.
The response body contains an error document in this case.
@RESTRETURNCODE{405}
is returned if the operation was called with a different HTTP METHOD than PUT.
@EXAMPLES
<div class="example-container" id="RestSimpleRemove_container">
<a class="anchorjs-link " href="#RestSimpleRemove_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleRemove_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"test0"</span>,
<span class="hljs-string">"test1"</span>,
<span class="hljs-string">"test2"</span>,
<span class="hljs-string">"test3"</span>,
<span class="hljs-string">"test4"</span>,
<span class="hljs-string">"test5"</span>,
<span class="hljs-string">"test6"</span>,
<span class="hljs-string">"test7"</span>,
<span class="hljs-string">"test8"</span>,
<span class="hljs-string">"test9"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"removed"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleRemove_container_collapse" onclick="$('#RestSimpleRemove_long').hide(); $('#RestSimpleRemove_short').show(); window.location.hash='RestSimpleRemove_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleRemove_short" onclick="$('#RestSimpleRemove_short').hide(); $('#RestSimpleRemove_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"test0"</span>,
<span class="hljs-string">"test1"</span>,
<span class="hljs-string">"test2"</span>,
<span class="hljs-string">"test3"</span>,
<span class="hljs-string">"test4"</span>,
<span class="hljs-string">"test5"</span>,
<span class="hljs-string">"test6"</span>,
<span class="hljs-string">"test7"</span>,
<span class="hljs-string">"test8"</span>,
<span class="hljs-string">"test9"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
<div class="example-container" id="RestSimpleRemoveNotFound_container">
<a class="anchorjs-link " href="#RestSimpleRemoveNotFound_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleRemoveNotFound_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"foo"</span>,
<span class="hljs-string">"bar"</span>,
<span class="hljs-string">"baz"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"removed"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"ignored"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleRemoveNotFound_container_collapse" onclick="$('#RestSimpleRemoveNotFound_long').hide(); $('#RestSimpleRemoveNotFound_short').show(); window.location.hash='RestSimpleRemoveNotFound_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleRemoveNotFound_short" onclick="$('#RestSimpleRemoveNotFound_short').hide(); $('#RestSimpleRemoveNotFound_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"foo"</span>,
<span class="hljs-string">"bar"</span>,
<span class="hljs-string">"baz"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_range.md -->
@startDocuBlock put_api_simple_range
@brief returns all documents of a collection within a range
@RESTHEADER{PUT /_api/simple/range, Simple range query}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{attribute,string,required,string}
The attribute path to check.
@RESTBODYPARAM{left,string,required,string}
The lower bound.
@RESTBODYPARAM{right,string,required,string}
The upper bound.
@RESTBODYPARAM{closed,boolean,required,}
If *true*, use interval including *left* and *right*,
otherwise exclude *right*, but include *left*.
@RESTBODYPARAM{skip,string,required,string}
The number of documents to skip in the query (optional).
@RESTBODYPARAM{limit,integer,optional,int64}
The maximal amount of documents to return. The *skip*
is applied before the *limit* restriction. (optional)
@RESTDESCRIPTION
This will find all documents within a given range. In order to execute a
range query, a skip-list index on the queried attribute must be present.
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
Note: the *range* simple query 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 within a specific range
is to use an AQL query as follows:
FOR doc IN @@collection
FILTER doc.value >= @left && doc.value < @right
LIMIT @skip, @limit
RETURN doc`
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown or no
suitable index for the range query is present. The response body contains
an error document in this case.
@EXAMPLES
<div class="example-container" id="RestSimpleRange_container">
<a class="anchorjs-link " href="#RestSimpleRange_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleRange_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/range</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"attribute"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"left"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-number">4</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70828"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70828"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z9a--B"</span>,
<span class="hljs-string">"i"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70830"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70830"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z9a--D"</span>,
<span class="hljs-string">"i"</span> : <span class="hljs-number">3</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleRange_container_collapse" onclick="$('#RestSimpleRange_long').hide(); $('#RestSimpleRange_short').show(); window.location.hash='RestSimpleRange_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleRange_short" onclick="$('#RestSimpleRange_short').hide(); $('#RestSimpleRange_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/range</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"attribute"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"left"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"right"</span> : <span class="hljs-number">4</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_update_by_example.md -->
@startDocuBlock put_api_simple_update_by_example
@brief partially updates the body of all documents of a collection that match an example
@RESTHEADER{PUT /_api/simple/update-by-example, Update documents by example}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to update within.
@RESTBODYPARAM{example,string,required,string}
An example document that all collection documents are compared against.
@RESTBODYPARAM{newValue,object,required,}
A document containing all the attributes to update in the found documents.
@RESTBODYPARAM{options,object,optional,put_api_simple_update_by_example_options}
a json object which can contains following attributes:
@RESTSTRUCT{keepNull,put_api_simple_update_by_example_options,boolean,optional,}
This parameter can be used to modify the behavior when
handling *null* values. Normally, *null* values are stored in the
database. By setting the *keepNull* parameter to *false*, this
behavior can be changed so that all attributes in *data* with *null*
values will be removed from the updated document.
@RESTSTRUCT{waitForSync,put_api_simple_update_by_example_options,boolean,optional,}
if set to true, then all removal operations will
instantly be synchronized to disk. If this is not specified, then the
collection's default sync behavior will be applied.
@RESTSTRUCT{limit,put_api_simple_update_by_example_options,integer,optional,int64}
an optional value that determines how many documents to
update at most. If *limit* is specified but is less than the number
of documents in the collection, it is undefined which of the documents
will be updated.
@RESTSTRUCT{mergeObjects,put_api_simple_update_by_example_options,boolean,optional,}
Controls whether objects (not arrays) will be merged if present in both the
existing and the patch document. If set to false, the value in the
patch document will overwrite the existing document's value. If set to
true, objects will be merged. The default is true.
@RESTDESCRIPTION
This will find all documents in the collection that match the specified
example object, and partially update the document body with the new value
specified. Note that document meta-attributes such as *_id*, *_key*,
*_from*, *_to* etc. cannot be replaced.
Note: the *limit* attribute is not supported on sharded collections.
Using it will result in an error.
Returns the number of documents that were updated.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the collection was updated successfully and *waitForSync* was
*true*.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
using old syntax for options
<div class="example-container" id="RestSimpleUpdateByExample_container">
<a class="anchorjs-link " href="#RestSimpleUpdateByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleUpdateByExample_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">22</span>
}
},
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"updated"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleUpdateByExample_container_collapse" onclick="$('#RestSimpleUpdateByExample_long').hide(); $('#RestSimpleUpdateByExample_short').show(); window.location.hash='RestSimpleUpdateByExample_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleUpdateByExample_short" onclick="$('#RestSimpleUpdateByExample_short').hide(); $('#RestSimpleUpdateByExample_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">22</span>
}
},
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
using new signature for options
<div class="example-container" id="RestSimpleUpdateByExample_1_container">
<a class="anchorjs-link " href="#RestSimpleUpdateByExample_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleUpdateByExample_1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">22</span>
}
},
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"updated"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleUpdateByExample_1_container_collapse" onclick="$('#RestSimpleUpdateByExample_1_long').hide(); $('#RestSimpleUpdateByExample_1_short').show(); window.location.hash='RestSimpleUpdateByExample_1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleUpdateByExample_1_short" onclick="$('#RestSimpleUpdateByExample_1_short').hide(); $('#RestSimpleUpdateByExample_1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/update-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">22</span>
}
},
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_first_example.md -->
@startDocuBlock put_api_simple_first_example
@brief returns one document of a collection matching a given example
@RESTHEADER{PUT /_api/simple/first-example, Find documents matching an example}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
{% hint 'warning' %}
Till ArangoDB versions 3.2.13 and 3.3.7 this API is quite expensive.
A more lightweight alternative is to use the [HTTP Cursor API](../AqlQueryCursor/README.md).
Starting from versions 3.2.14 and 3.3.8 this performance impact is not
an issue anymore, as the internal implementation of the API has changed.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{example,string,required,string}
The example document.
@RESTDESCRIPTION
This will return the first document matching a given example.
Returns a result containing the document or *HTTP 404* if no
document matched the example.
If more than one document in the collection matches the specified example, only
one of these documents will be returned, and it is undefined which of the matching
documents is returned.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned when the query was successfully executed.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
If a matching document was found
<div class="example-container" id="RestSimpleFirstExample_container">
<a class="anchorjs-link " href="#RestSimpleFirstExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleFirstExample_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/first-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"document"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70662"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70662"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z6---A"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"k"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleFirstExample_container_collapse" onclick="$('#RestSimpleFirstExample_long').hide(); $('#RestSimpleFirstExample_short').show(); window.location.hash='RestSimpleFirstExample_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleFirstExample_short" onclick="$('#RestSimpleFirstExample_short').hide(); $('#RestSimpleFirstExample_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/first-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
If no document was found
<div class="example-container" id="RestSimpleFirstExampleNotFound_container">
<a class="anchorjs-link " href="#RestSimpleFirstExampleNotFound_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleFirstExampleNotFound_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/first-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"l"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"no match"</span>
}
</pre>
<div id="RestSimpleFirstExampleNotFound_container_collapse" onclick="$('#RestSimpleFirstExampleNotFound_long').hide(); $('#RestSimpleFirstExampleNotFound_short').show(); window.location.hash='RestSimpleFirstExampleNotFound_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleFirstExampleNotFound_short" onclick="$('#RestSimpleFirstExampleNotFound_short').hide(); $('#RestSimpleFirstExampleNotFound_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/first-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"l"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/RestLookupByKeys.md -->
@startDocuBlock RestLookupByKeys
@brief fetches multiple documents by their keys
@RESTHEADER{PUT /_api/simple/lookup-by-keys, Find documents by their keys}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to look in for the documents
@RESTBODYPARAM{keys,array,required,string}
array with the _keys of documents to remove.
@RESTDESCRIPTION
Looks up the documents in the specified collection
using the array of keys provided. All documents for which a matching
key was specified in the *keys* array and that exist in the collection
will be returned. Keys for which no document can be found in the
underlying collection are ignored, and no exception will be thrown for
them.
Equivalent AQL query:
FOR doc IN @@collection FILTER doc._key IN @keys RETURN doc
The body of the response contains a JSON object with a *documents*
attribute. The *documents* attribute is an array containing the
matching documents. The order in which matching documents are present
in the result array is unspecified.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the operation was carried out successfully.
@RESTRETURNCODE{404}
is returned if the collection was not found. The response body
contains an error document in this case.
@RESTRETURNCODE{405}
is returned if the operation was called with a different HTTP METHOD than PUT.
@EXAMPLES
Looking up existing documents
<div class="example-container" id="RestSimpleLookup_container">
<a class="anchorjs-link " href="#RestSimpleLookup_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleLookup_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/lookup-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"test0"</span>,
<span class="hljs-string">"test1"</span>,
<span class="hljs-string">"test2"</span>,
<span class="hljs-string">"test3"</span>,
<span class="hljs-string">"test4"</span>,
<span class="hljs-string">"test5"</span>,
<span class="hljs-string">"test6"</span>,
<span class="hljs-string">"test7"</span>,
<span class="hljs-string">"test8"</span>,
<span class="hljs-string">"test9"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"documents"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test0"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test0"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7O--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test1"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test1"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7S---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test2"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test2"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7S--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test3"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test3"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7S--C"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">3</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test4"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test4"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7S--E"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">4</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test5"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test5"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7W---"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">5</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test6"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test6"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7W--A"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">6</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test7"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test7"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7W--C"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">7</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test8"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test8"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7W--E"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">8</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"test9"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"test/test9"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z7W--G"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">9</span>
}
],
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleLookup_container_collapse" onclick="$('#RestSimpleLookup_long').hide(); $('#RestSimpleLookup_short').show(); window.location.hash='RestSimpleLookup_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleLookup_short" onclick="$('#RestSimpleLookup_short').hide(); $('#RestSimpleLookup_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/lookup-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"test0"</span>,
<span class="hljs-string">"test1"</span>,
<span class="hljs-string">"test2"</span>,
<span class="hljs-string">"test3"</span>,
<span class="hljs-string">"test4"</span>,
<span class="hljs-string">"test5"</span>,
<span class="hljs-string">"test6"</span>,
<span class="hljs-string">"test7"</span>,
<span class="hljs-string">"test8"</span>,
<span class="hljs-string">"test9"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Looking up non-existing documents
<div class="example-container" id="RestSimpleLookupNotFound_container">
<a class="anchorjs-link " href="#RestSimpleLookupNotFound_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleLookupNotFound_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/lookup-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"foo"</span>,
<span class="hljs-string">"bar"</span>,
<span class="hljs-string">"baz"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"documents"</span> : [ ],
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleLookupNotFound_container_collapse" onclick="$('#RestSimpleLookupNotFound_long').hide(); $('#RestSimpleLookupNotFound_short').show(); window.location.hash='RestSimpleLookupNotFound_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleLookupNotFound_short" onclick="$('#RestSimpleLookupNotFound_short').hide(); $('#RestSimpleLookupNotFound_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/lookup-by-keys</span> &lt;&lt;EOF
{
<span class="hljs-string">"keys"</span> : [
<span class="hljs-string">"foo"</span>,
<span class="hljs-string">"bar"</span>,
<span class="hljs-string">"baz"</span>
],
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"test"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_all.md -->
@startDocuBlock put_api_simple_all
@brief returns all documents of a collection
@RESTHEADER{PUT /_api/simple/all, Return all documents}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTALLBODYPARAM{query,string,required}
Contains the query.
@RESTDESCRIPTION
Returns all documents of a collections. Equivalent to the AQL query
`FOR doc IN collection RETURN doc`. The call expects a JSON object
as body with the following attributes:
- *collection*: The name of the collection to query.
- *skip*: The number of documents to skip in the query (optional).
- *limit*: The maximal amount of documents to return. The *skip*
is applied before the *limit* restriction (optional).
- *batchSize*: The number of documents to return in one go. (optional)
- *ttl*: The time-to-live for the cursor (in seconds, optional).
- *stream*: Create this cursor as a stream query (optional).
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
Limit the amount of documents using *limit*
<div class="example-container" id="RestSimpleAllSkipLimit_container">
<a class="anchorjs-link " href="#RestSimpleAllSkipLimit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleAllSkipLimit_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all</span> &lt;&lt;EOF
{ "collection": "products", "skip": 2, "limit" : 2 }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70582"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70582"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z4C--A"</span>,
<span class="hljs-string">"Hello3"</span> : <span class="hljs-string">"World3"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70584"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70584"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z4C--C"</span>,
<span class="hljs-string">"Hello4"</span> : <span class="hljs-string">"World4"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00016736984252929688</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">2510</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleAllSkipLimit_container_collapse" onclick="$('#RestSimpleAllSkipLimit_long').hide(); $('#RestSimpleAllSkipLimit_short').show(); window.location.hash='RestSimpleAllSkipLimit_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleAllSkipLimit_short" onclick="$('#RestSimpleAllSkipLimit_short').hide(); $('#RestSimpleAllSkipLimit_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all</span> &lt;&lt;EOF
{ "collection": "products", "skip": 2, "limit" : 2 }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using a *batchSize* value
<div class="example-container" id="RestSimpleAllBatch_container">
<a class="anchorjs-link " href="#RestSimpleAllBatch_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleAllBatch_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all</span> &lt;&lt;EOF
{ "collection": "products", "batchSize" : 3 }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70559"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70559"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z3m---"</span>,
<span class="hljs-string">"Hello1"</span> : <span class="hljs-string">"World1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70561"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70561"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z3m--A"</span>,
<span class="hljs-string">"Hello2"</span> : <span class="hljs-string">"World2"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70563"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70563"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z3m--C"</span>,
<span class="hljs-string">"Hello3"</span> : <span class="hljs-string">"World3"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"70569"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.0002779960632324219</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">18351</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleAllBatch_container_collapse" onclick="$('#RestSimpleAllBatch_long').hide(); $('#RestSimpleAllBatch_short').show(); window.location.hash='RestSimpleAllBatch_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleAllBatch_short" onclick="$('#RestSimpleAllBatch_short').hide(); $('#RestSimpleAllBatch_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/all</span> &lt;&lt;EOF
{ "collection": "products", "batchSize" : 3 }
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_within.md -->
@startDocuBlock put_api_simple_within
@brief returns all documents of a collection within a given radius
@RESTHEADER{PUT /_api/simple/within, Find documents within a radius around a coordinate}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{latitude,string,required,string}
The latitude of the coordinate.
@RESTBODYPARAM{longitude,string,required,string}
The longitude of the coordinate.
@RESTBODYPARAM{radius,string,required,string}
The maximal radius (in meters).
@RESTBODYPARAM{distance,string,required,string}
If given, the attribute key used to return the distance to
the given coordinate. (optional). If specified, distances are returned in meters.
@RESTBODYPARAM{skip,string,required,string}
The number of documents to skip in the query. (optional)
@RESTBODYPARAM{limit,string,required,string}
The maximal amount of documents to return. The *skip* is
applied before the *limit* restriction. The default is 100. (optional)
@RESTBODYPARAM{geo,string,required,string}
If given, the identifier of the geo-index to use. (optional)
@RESTDESCRIPTION
This will find all documents within a given radius around the coordinate
(*latitude*, *longitude*). The returned list is sorted by distance.
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 than one geo-spatial index,
you can use the *geo* field to select a particular index.
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
Note: the *within* simple query is **deprecated** as of ArangoDB 2.6.
This API may be removed in future versions of ArangoDB. The preferred
way for retrieving documents from a collection using the near operator is
to issue an [AQL query](../../AQL/Functions/Geo.html) using the *WITHIN* function as follows:
FOR doc IN WITHIN(@@collection, @latitude, @longitude, @radius, @distanceAttributeName)
RETURN doc
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
Without distance
<div class="example-container" id="RestSimpleWithin_container">
<a class="anchorjs-link " href="#RestSimpleWithin_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleWithin_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"radius"</span> : <span class="hljs-number">500</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71003"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71003"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aBS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-0.002/"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-0.002</span>,
<span class="hljs-number">0</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71007"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71007"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aBS--E"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.002/"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.002</span>,
<span class="hljs-number">0</span>
]
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleWithin_container_collapse" onclick="$('#RestSimpleWithin_long').hide(); $('#RestSimpleWithin_short').show(); window.location.hash='RestSimpleWithin_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleWithin_short" onclick="$('#RestSimpleWithin_short').hide(); $('#RestSimpleWithin_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"radius"</span> : <span class="hljs-number">500</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
With distance
<div class="example-container" id="RestSimpleWithinDistance_container">
<a class="anchorjs-link " href="#RestSimpleWithinDistance_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleWithinDistance_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-string">"distance"</span>,
<span class="hljs-string">"radius"</span> : <span class="hljs-number">300</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71039"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71039"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aBu--C"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-0.002</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-0.002/"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">222.3898532891175</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71043"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71043"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aBu--G"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.002</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.002/"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">222.3898532891175</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71045"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71045"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aBy---"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.004</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.004/"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">444.779706578235</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleWithinDistance_container_collapse" onclick="$('#RestSimpleWithinDistance_long').hide(); $('#RestSimpleWithinDistance_short').show(); window.location.hash='RestSimpleWithinDistance_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleWithinDistance_short" onclick="$('#RestSimpleWithinDistance_short').hide(); $('#RestSimpleWithinDistance_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-string">"distance"</span>,
<span class="hljs-string">"radius"</span> : <span class="hljs-number">300</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_within_rectangle.md -->
@startDocuBlock put_api_simple_within_rectangle
@brief returns all documents of a collection within a rectangle
@RESTHEADER{PUT /_api/simple/within-rectangle, Within rectangle query}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{latitude1,string,required,string}
The latitude of the first rectangle coordinate.
@RESTBODYPARAM{longitude1,string,required,string}
The longitude of the first rectangle coordinate.
@RESTBODYPARAM{latitude2,string,required,string}
The latitude of the second rectangle coordinate.
@RESTBODYPARAM{longitude2,string,required,string}
The longitude of the second rectangle coordinate.
@RESTBODYPARAM{skip,string,required,string}
The number of documents to skip in the query. (optional)
@RESTBODYPARAM{limit,string,required,string}
The maximal amount of documents to return. The *skip* is
applied before the *limit* restriction. The default is 100. (optional)
@RESTBODYPARAM{geo,string,required,string}
If given, the identifier of the geo-index to use. (optional)
@RESTDESCRIPTION
This will find all documents within the specified rectangle (determined by
the given coordinates (*latitude1*, *longitude1*, *latitude2*, *longitude2*).
In order to use the *within-rectangle* query, 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 than one geo-spatial index,
you can use the *geo* field to select a particular index.
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
<div class="example-container" id="RestSimpleWithinRectangle_container">
<a class="anchorjs-link " href="#RestSimpleWithinRectangle_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleWithinRectangle_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/within-rectangle</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude1"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude1"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"latitude2"</span> : <span class="hljs-number">0.2</span>,
<span class="hljs-string">"longitude2"</span> : <span class="hljs-number">0.2</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71085"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71085"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aCS--A"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.008/"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.008</span>,
<span class="hljs-number">0</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"71083"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/71083"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6aCS---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.006/"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.006</span>,
<span class="hljs-number">0</span>
]
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleWithinRectangle_container_collapse" onclick="$('#RestSimpleWithinRectangle_long').hide(); $('#RestSimpleWithinRectangle_short').show(); window.location.hash='RestSimpleWithinRectangle_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleWithinRectangle_short" onclick="$('#RestSimpleWithinRectangle_short').hide(); $('#RestSimpleWithinRectangle_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/within-rectangle</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude1"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude1"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"latitude2"</span> : <span class="hljs-number">0.2</span>,
<span class="hljs-string">"longitude2"</span> : <span class="hljs-number">0.2</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_near.md -->
@startDocuBlock put_api_simple_near
@brief returns all documents of a collection near a given location
@RESTHEADER{PUT /_api/simple/near, Returns documents near a coordinate}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{latitude,string,required,string}
The latitude of the coordinate.
@RESTBODYPARAM{longitude,string,required,string}
The longitude of the coordinate.
@RESTBODYPARAM{distance,string,required,string}
If given, the attribute key used to return the distance to
the given coordinate. (optional). If specified, distances are returned in meters.
@RESTBODYPARAM{skip,string,required,string}
The number of documents to skip in the query. (optional)
@RESTBODYPARAM{limit,string,required,string}
The maximal amount of documents to return. The *skip* is
applied before the *limit* restriction. The default is 100. (optional)
@RESTBODYPARAM{geo,string,required,string}
If given, the identifier of the geo-index to use. (optional)
@RESTDESCRIPTION
The default will find at most 100 documents near the given coordinate. The
returned array is sorted according to the distance, with the nearest document
being first in the return array. If there are near documents of equal distance, documents
are chosen randomly from this set until the limit is reached.
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 than one geo-spatial index, you can use
the *geo* field to select a particular index.
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
Note: the *near* simple query is **deprecated** as of ArangoDB 2.6.
This API may be removed in future versions of ArangoDB. The preferred
way for retrieving documents from a collection using the near operator is
to issue an [AQL query](../../AQL/Functions/Geo.html) using the *NEAR* function as follows:
FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit)
RETURN doc`
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
Without distance
<div class="example-container" id="RestSimpleNear_container">
<a class="anchorjs-link " href="#RestSimpleNear_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleNear_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70762"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70762"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z8O--C"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-0.002/"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-0.002</span>,
<span class="hljs-number">0</span>
]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70766"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70766"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z8O--G"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.002/"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.002</span>,
<span class="hljs-number">0</span>
]
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleNear_container_collapse" onclick="$('#RestSimpleNear_long').hide(); $('#RestSimpleNear_short').show(); window.location.hash='RestSimpleNear_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleNear_short" onclick="$('#RestSimpleNear_short').hide(); $('#RestSimpleNear_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
With distance
<div class="example-container" id="RestSimpleNearDistance_container">
<a class="anchorjs-link " href="#RestSimpleNearDistance_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleNearDistance_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-string">"distance"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70798"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70798"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z82--C"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">-0.002</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/-0.002/"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">222.3898532891175</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70802"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70802"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z86---"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.002</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.002/"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">222.3898532891175</span>
},
{
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70804"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70804"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z86--A"</span>,
<span class="hljs-string">"loc"</span> : [
<span class="hljs-number">0.004</span>,
<span class="hljs-number">0</span>
],
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Name/0.004/"</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-number">444.779706578235</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleNearDistance_container_collapse" onclick="$('#RestSimpleNearDistance_long').hide(); $('#RestSimpleNearDistance_short').show(); window.location.hash='RestSimpleNearDistance_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleNearDistance_short" onclick="$('#RestSimpleNearDistance_short').hide(); $('#RestSimpleNearDistance_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/near</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"latitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"longitude"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skip"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"distance"</span> : <span class="hljs-string">"distance"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_by_example.md -->
@startDocuBlock put_api_simple_by_example
@brief returns all documents of a collection matching a given example
@RESTHEADER{PUT /_api/simple/by-example, Simple query by-example}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
{% hint 'warning' %}
Till ArangoDB versions 3.2.13 and 3.3.7 this API is quite expensive.
A more lightweight alternative is to use the [HTTP Cursor API](../AqlQueryCursor/README.md).
Starting from versions 3.2.14 and 3.3.8 this performance impact is not
an issue anymore, as the internal implementation of the API has changed.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{example,string,required,string}
The example document.
@RESTBODYPARAM{skip,string,required,string}
The number of documents to skip in the query (optional).
@RESTBODYPARAM{limit,string,required,string}
The maximal amount of documents to return. The *skip*
is applied before the *limit* restriction. (optional)
@RESTBODYPARAM{batchSize,integer,optional,int64}
maximum number of result documents to be transferred from
the server to the client in one roundtrip. If this attribute is
not set, a server-controlled default value will be used. A *batchSize* value of
*0* is disallowed.
@RESTDESCRIPTION
This will find all documents matching a given example.
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
Matching an attribute
<div class="example-container" id="RestSimpleByExample_container">
<a class="anchorjs-link " href="#RestSimpleByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleByExample_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70614"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70614"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z46--A"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"k"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70616"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70616"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z46--C"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70618"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70618"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z46--E"</span>,
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70620"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70620"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z5----"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"k"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"j"</span> : <span class="hljs-number">2</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00024771690368652344</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">36641</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleByExample_container_collapse" onclick="$('#RestSimpleByExample_long').hide(); $('#RestSimpleByExample_short').show(); window.location.hash='RestSimpleByExample_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleByExample_short" onclick="$('#RestSimpleByExample_short').hide(); $('#RestSimpleByExample_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Matching an attribute which is a sub-document
<div class="example-container" id="RestSimpleByExample2_container">
<a class="anchorjs-link " href="#RestSimpleByExample2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleByExample2_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a.j"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70630"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70630"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z5S--A"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"k"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70632"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70632"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z5S--C"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00019693374633789062</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">36921</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleByExample2_container_collapse" onclick="$('#RestSimpleByExample2_long').hide(); $('#RestSimpleByExample2_short').show(); window.location.hash='RestSimpleByExample2_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleByExample2_short" onclick="$('#RestSimpleByExample2_short').hide(); $('#RestSimpleByExample2_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a.j"</span> : <span class="hljs-number">1</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Matching an attribute within a sub-document
<div class="example-container" id="RestSimpleByExample3_container">
<a class="anchorjs-link " href="#RestSimpleByExample3_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleByExample3_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70648"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70648"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z5q--A"</span>,
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"i"</span> : <span class="hljs-number">1</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"cached"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"extra"</span> : {
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"writesExecuted"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writesIgnored"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"scannedFull"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"httpRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"executionTime"</span> : <span class="hljs-number">0.00019240379333496094</span>,
<span class="hljs-string">"peakMemoryUsage"</span> : <span class="hljs-number">37201</span>
},
<span class="hljs-string">"warnings"</span> : [ ]
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleByExample3_container_collapse" onclick="$('#RestSimpleByExample3_long').hide(); $('#RestSimpleByExample3_short').show(); window.location.hash='RestSimpleByExample3_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleByExample3_short" onclick="$('#RestSimpleByExample3_short').hide(); $('#RestSimpleByExample3_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_remove_by_example.md -->
@startDocuBlock put_api_simple_remove_by_example
@brief removes all documents of a collection that match an example
@RESTHEADER{PUT /_api/simple/remove-by-example, Remove documents by example}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to remove from.
@RESTBODYPARAM{example,string,required,string}
An example document that all collection documents are compared against.
@RESTBODYPARAM{options,object,optional,put_api_simple_remove_by_example_opts}
a json object which can contains following attributes:
@RESTSTRUCT{waitForSync,put_api_simple_remove_by_example_opts,boolean,optional,}
if set to true, then all removal operations will
instantly be synchronized to disk. If this is not specified, then the
collection's default sync behavior will be applied.
@RESTSTRUCT{limit,put_api_simple_remove_by_example_opts,string,required,string}
an optional value that determines how many documents to
delete at most. If *limit* is specified but is less than the number
of documents in the collection, it is undefined which of the documents
will be deleted.
@RESTDESCRIPTION
This will find all documents in the collection that match the specified
example object.
Note: the *limit* attribute is not supported on sharded collections.
Using it will result in an error.
Returns the number of documents that were deleted.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
<div class="example-container" id="RestSimpleRemoveByExample_container">
<a class="anchorjs-link " href="#RestSimpleRemoveByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleRemoveByExample_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deleted"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleRemoveByExample_container_collapse" onclick="$('#RestSimpleRemoveByExample_long').hide(); $('#RestSimpleRemoveByExample_short').show(); window.location.hash='RestSimpleRemoveByExample_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleRemoveByExample_short" onclick="$('#RestSimpleRemoveByExample_short').hide(); $('#RestSimpleRemoveByExample_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using Parameter: waitForSync and limit
<div class="example-container" id="RestSimpleRemoveByExample_1_container">
<a class="anchorjs-link " href="#RestSimpleRemoveByExample_1_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleRemoveByExample_1_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deleted"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleRemoveByExample_1_container_collapse" onclick="$('#RestSimpleRemoveByExample_1_long').hide(); $('#RestSimpleRemoveByExample_1_short').show(); window.location.hash='RestSimpleRemoveByExample_1_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleRemoveByExample_1_short" onclick="$('#RestSimpleRemoveByExample_1_short').hide(); $('#RestSimpleRemoveByExample_1_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using Parameter: waitForSync and limit with new signature
<div class="example-container" id="RestSimpleRemoveByExample_2_container">
<a class="anchorjs-link " href="#RestSimpleRemoveByExample_2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleRemoveByExample_2_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"deleted"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleRemoveByExample_2_container_collapse" onclick="$('#RestSimpleRemoveByExample_2_long').hide(); $('#RestSimpleRemoveByExample_2_short').show(); window.location.hash='RestSimpleRemoveByExample_2_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleRemoveByExample_2_short" onclick="$('#RestSimpleRemoveByExample_2_short').hide(); $('#RestSimpleRemoveByExample_2_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/remove-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">2</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_fulltext.md -->
@startDocuBlock put_api_simple_fulltext
@brief returns documents of a collection as a result of a fulltext query
@RESTHEADER{PUT /_api/simple/fulltext, Fulltext index query}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to query.
@RESTBODYPARAM{attribute,string,required,string}
The attribute that contains the texts.
@RESTBODYPARAM{query,string,required,string}
The fulltext query. Please refer to [Fulltext queries](../../Manual/Appendix/Deprecated/SimpleQueries/FulltextQueries.html)
for details.
@RESTBODYPARAM{skip,string,required,string}
The number of documents to skip in the query (optional).
@RESTBODYPARAM{limit,string,required,string}
The maximal amount of documents to return. The *skip*
is applied before the *limit* restriction. (optional)
@RESTBODYPARAM{index,string,required,string}
The identifier of the fulltext-index to use.
@RESTDESCRIPTION
This will find all documents from the collection that match the fulltext
query specified in *query*.
In order to use the *fulltext* operator, a fulltext index must be defined
for the collection and the specified attribute.
Returns a cursor containing the result, see [HTTP Cursor](../AqlQueryCursor/README.md) for details.
Note: the *fulltext* simple query is **deprecated** as of ArangoDB 2.6.
This API may be removed in future versions of ArangoDB. The preferred
way for retrieving documents from a collection using the near operator is
to issue an AQL query using the *FULLTEXT* [AQL function](../../AQL/Functions/Fulltext.html)
as follows:
FOR doc IN FULLTEXT(@@collection, @attributeName, @queryString, @limit)
RETURN doc
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
<div class="example-container" id="RestSimpleFulltext_container">
<a class="anchorjs-link " href="#RestSimpleFulltext_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleFulltext_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/fulltext</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"attribute"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"query"</span> : <span class="hljs-string">"word"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"result"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70694"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70694"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z6u--A"</span>,
<span class="hljs-string">"text"</span> : <span class="hljs-string">"this text contains word"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70696"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70696"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z6u--C"</span>,
<span class="hljs-string">"text"</span> : <span class="hljs-string">"this text also has a word"</span>
}
],
<span class="hljs-string">"hasMore"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>
}
</pre>
<div id="RestSimpleFulltext_container_collapse" onclick="$('#RestSimpleFulltext_long').hide(); $('#RestSimpleFulltext_short').show(); window.location.hash='RestSimpleFulltext_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleFulltext_short" onclick="$('#RestSimpleFulltext_short').hide(); $('#RestSimpleFulltext_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/fulltext</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"attribute"</span> : <span class="hljs-string">"text"</span>,
<span class="hljs-string">"query"</span> : <span class="hljs-string">"word"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_replace_by_example.md -->
@startDocuBlock put_api_simple_replace_by_example
@brief replaces the body of all documents of a collection that match an example
@RESTHEADER{PUT /_api/simple/replace-by-example, Replace documents by example}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTBODYPARAM{collection,string,required,string}
The name of the collection to replace within.
@RESTBODYPARAM{example,string,required,string}
An example document that all collection documents are compared against.
@RESTBODYPARAM{newValue,string,required,string}
The replacement document that will get inserted in place
of the "old" documents.
@RESTBODYPARAM{options,object,optional,put_api_simple_replace_by_example_options}
a json object which can contain following attributes
@RESTSTRUCT{waitForSync,put_api_simple_replace_by_example_options,boolean,optional,}
if set to true, then all removal operations will
instantly be synchronized to disk. If this is not specified, then the
collection's default sync behavior will be applied.
@RESTSTRUCT{limit,put_api_simple_replace_by_example_options,string,optional,string}
an optional value that determines how many documents to
replace at most. If *limit* is specified but is less than the number
of documents in the collection, it is undefined which of the documents
will be replaced.
@RESTDESCRIPTION
This will find all documents in the collection that match the specified
example object, and replace the entire document body with the new value
specified. Note that document meta-attributes such as *_id*, *_key*,
*_from*, *_to* etc. cannot be replaced.
Note: the *limit* attribute is not supported on sharded collections.
Using it will result in an error.
Returns the number of documents that were replaced.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
<div class="example-container" id="RestSimpleReplaceByExample_container">
<a class="anchorjs-link " href="#RestSimpleReplaceByExample_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleReplaceByExample_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>
},
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"replaced"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleReplaceByExample_container_collapse" onclick="$('#RestSimpleReplaceByExample_long').hide(); $('#RestSimpleReplaceByExample_short').show(); window.location.hash='RestSimpleReplaceByExample_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleReplaceByExample_short" onclick="$('#RestSimpleReplaceByExample_short').hide(); $('#RestSimpleReplaceByExample_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>
},
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using new Signature for attributes WaitForSync and limit
<div class="example-container" id="RestSimpleReplaceByExampleWaitForSync_container">
<a class="anchorjs-link " href="#RestSimpleReplaceByExampleWaitForSync_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleReplaceByExampleWaitForSync_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>
},
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"replaced"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleReplaceByExampleWaitForSync_container_collapse" onclick="$('#RestSimpleReplaceByExampleWaitForSync_long').hide(); $('#RestSimpleReplaceByExampleWaitForSync_short').show(); window.location.hash='RestSimpleReplaceByExampleWaitForSync_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleReplaceByExampleWaitForSync_short" onclick="$('#RestSimpleReplaceByExampleWaitForSync_short').hide(); $('#RestSimpleReplaceByExampleWaitForSync_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/replace-by-example</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"example"</span> : {
<span class="hljs-string">"a"</span> : {
<span class="hljs-string">"j"</span> : <span class="hljs-number">1</span>
}
},
<span class="hljs-string">"newValue"</span> : {
<span class="hljs-string">"foo"</span> : <span class="hljs-string">"bar"</span>
},
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"limit"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Simple Queries/put_api_simple_any.md -->
@startDocuBlock put_api_simple_any
@brief returns a random document from a collection
@RESTHEADER{PUT /_api/simple/any, Return a random document}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
All endpoints for Simple Queries are deprecated from version 3.4.0 on.
They are superseded by AQL queries.
{% endhint %}
@RESTDESCRIPTION
Returns a random document from a collection. The call expects a JSON object
as body with the following attributes:
@RESTBODYPARAM{collection,string,required, string}
The identifier or name of the collection to query.
Returns a JSON object with the document stored in the attribute
*document* if the collection contains at least one document. If
the collection is empty, the *document* attribute contains null.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the query was executed successfully.
@RESTRETURNCODE{400}
is returned if the body does not contain a valid JSON representation of a
query. The response body contains an error document in this case.
@RESTRETURNCODE{404}
is returned if the collection specified by *collection* is unknown. The
response body contains an error document in this case.
@EXAMPLES
<div class="example-container" id="RestSimpleAny_container">
<a class="anchorjs-link " href="#RestSimpleAny_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestSimpleAny_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/any</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"document"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"70598"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"products/70598"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Z4W--C"</span>,
<span class="hljs-string">"Hello2"</span> : <span class="hljs-string">"World2"</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestSimpleAny_container_collapse" onclick="$('#RestSimpleAny_long').hide(); $('#RestSimpleAny_short').show(); window.location.hash='RestSimpleAny_container';" class="example_show_button">Hide response body</div></div>
<div id="RestSimpleAny_short" onclick="$('#RestSimpleAny_short').hide(); $('#RestSimpleAny_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/simple/any</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/DeleteApiQuerySlow.md -->
@startDocuBlock DeleteApiQuerySlow
@brief clears the list of slow AQL queries
@RESTHEADER{DELETE /_api/query/slow, Clears the list of slow AQL queries, deleteQuery}
@RESTDESCRIPTION
Clears the list of slow AQL queries
@RESTRETURNCODES
@RESTRETURNCODE{200}
The server will respond with *HTTP 200* when the list of queries was
cleared successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/PostApiQueryProperties.md -->
@startDocuBlock PostApiQueryProperties
@brief parse an AQL query and return information about it
@RESTHEADER{POST /_api/query, Parse an AQL query, parseQuery}
@RESTDESCRIPTION
This endpoint is for query validation only. To actually query the database,
see `/api/cursor`.
@RESTBODYPARAM{query,string,required,string}
To validate a query string without executing it, the query string can be
passed to the server via an HTTP POST request.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the query is valid, the server will respond with *HTTP 200* and
return the names of the bind parameters it found in the query (if any) in
the *bindVars* attribute of the response. It will also return an array
of the collections used in the query in the *collections* attribute.
If a query can be parsed successfully, the *ast* attribute of the returned
JSON will contain the abstract syntax tree representation of the query.
The format of the *ast* is subject to change in future versions of
ArangoDB, but it can be used to inspect how ArangoDB interprets a given
query. Note that the abstract syntax tree will be returned without any
optimizations applied to it.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
or if the query contains a parse error. The body of the response will
contain the error details embedded in a JSON object.
@EXAMPLES
a valid query
<div class="example-container" id="RestQueryValid_container">
<a class="anchorjs-link " href="#RestQueryValid_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestQueryValid_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/query</span> &lt;&lt;EOF
{ "query" : "FOR i IN 1..100 FILTER i > 10 LIMIT 2 RETURN i * 3" }
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"parsed"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"collections"</span> : [ ],
<span class="hljs-string">"bindVars"</span> : [ ],
<span class="hljs-string">"ast"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"for"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"variable"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"range"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">100</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"no-op"</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"filter"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare &gt;"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">10</span>
}
]
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"limit"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"return"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"times"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">3</span>
}
]
}
]
}
]
}
]
}
</pre>
<div id="RestQueryValid_container_collapse" onclick="$('#RestQueryValid_long').hide(); $('#RestQueryValid_short').show(); window.location.hash='RestQueryValid_container';" class="example_show_button">Hide response body</div></div>
<div id="RestQueryValid_short" onclick="$('#RestQueryValid_short').hide(); $('#RestQueryValid_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/query</span> &lt;&lt;EOF
{ "query" : "FOR i IN 1..100 FILTER i > 10 LIMIT 2 RETURN i * 3" }
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
an invalid query
<div class="example-container" id="RestQueryInvalid_container">
<a class="anchorjs-link " href="#RestQueryInvalid_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestQueryInvalid_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/query</span> &lt;&lt;EOF
{ "query" : "FOR i IN 1..100 FILTER i = 1 LIMIT 2 RETURN i * 3" }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"syntax error, unexpected assignment near '= 1 LIMIT 2 RETURN i * 3' at position 1:26"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1501</span>
}
</pre>
<div id="RestQueryInvalid_container_collapse" onclick="$('#RestQueryInvalid_long').hide(); $('#RestQueryInvalid_short').show(); window.location.hash='RestQueryInvalid_container';" class="example_show_button">Hide response body</div></div>
<div id="RestQueryInvalid_short" onclick="$('#RestQueryInvalid_short').hide(); $('#RestQueryInvalid_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/query</span> &lt;&lt;EOF
{ "query" : "FOR i IN 1..100 FILTER i = 1 LIMIT 2 RETURN i * 3" }
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/post_api_explain.md -->
@startDocuBlock post_api_explain
@brief explain an AQL query and return information about it
@RESTHEADER{POST /_api/explain, Explain an AQL query, explainQuery}
A JSON object describing the query and query parameters.
@RESTBODYPARAM{query,string,required,string}
the query which you want explained; If the query references any bind variables,
these must also be passed in the attribute *bindVars*. Additional
options for the query can be passed in the *options* attribute.
@RESTBODYPARAM{bindVars,array,optional,object}
key/value pairs representing the bind parameters.
@RESTBODYPARAM{options,object,optional,explain_options}
Options for the query
@RESTSTRUCT{allPlans,explain_options,boolean,optional,}
if set to *true*, all possible execution plans will be returned.
The default is *false*, meaning only the optimal plan will be returned.
@RESTSTRUCT{maxNumberOfPlans,explain_options,integer,optional,int64}
an optional maximum number of plans that the optimizer is
allowed to generate. Setting this attribute to a low value allows to put a
cap on the amount of work the optimizer does.
@RESTSTRUCT{optimizer.rules,explain_options,array,optional,string}
an array of to-be-included or to-be-excluded optimizer rules
can be put into this attribute, telling the optimizer to include or exclude
specific rules. To disable a rule, prefix its name with a `-`, to enable a rule, prefix it
with a `+`. There is also a pseudo-rule `all`, which will match all optimizer rules.
@RESTDESCRIPTION
To explain how an AQL query would be executed on the server, the query string
can be sent to the server via an HTTP POST request. The server will then validate
the query and create an execution plan for it. The execution plan will be
returned, but the query will not be executed.
The execution plan that is returned by the server can be used to estimate the
probable performance of the query. Though the actual performance will depend
on many different factors, the execution plan normally can provide some rough
estimates on the amount of work the server needs to do in order to actually run
the query.
By default, the explain operation will return the optimal plan as chosen by
the query optimizer The optimal plan is the plan with the lowest total estimated
cost. The plan will be returned in the attribute *plan* of the response object.
If the option *allPlans* is specified in the request, the result will contain
all plans created by the optimizer. The plans will then be returned in the
attribute *plans*.
The result will also contain an attribute *warnings*, which is an array of
warnings that occurred during optimization or execution plan creation. Additionally,
a *stats* attribute is contained in the result with some optimizer statistics.
If *allPlans* is set to *false*, the result will contain an attribute *cacheable*
that states whether the query results can be cached on the server if the query
result cache were used. The *cacheable* attribute is not present when *allPlans*
is set to *true*.
Each plan in the result is a JSON object with the following attributes:
- *nodes*: the array of execution nodes of the plan. The array of available node types
can be found [here](../../AQL/ExecutionAndPerformance/Optimizer.html)
- *estimatedCost*: the total estimated cost for the plan. If there are multiple
plans, the optimizer will choose the plan with the lowest total cost.
- *collections*: an array of collections used in the query
- *rules*: an array of rules the optimizer applied. An overview of the
available rules can be found [here](../../AQL/ExecutionAndPerformance/Optimizer.html)
- *variables*: array of variables used in the query (note: this may contain
internal variables created by the optimizer)
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the query is valid, the server will respond with *HTTP 200* and
return the optimal execution plan in the *plan* attribute of the response.
If option *allPlans* was set in the request, an array of plans will be returned
in the *allPlans* attribute instead.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
or if the query contains a parse error. The body of the response will
contain the error details embedded in a JSON object.
Omitting bind variables if the query references any will also result
in an *HTTP 400* error.
@RESTRETURNCODE{404}
The server will respond with *HTTP 404* in case a non-existing collection is
accessed in the query.
@EXAMPLES
Valid query
<div class="example-container" id="RestExplainValid_container">
<a class="anchorjs-link " href="#RestExplainValid_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainValid_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products RETURN p"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateCollectionNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">12</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"random"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexHint"</span> : {
<span class="hljs-string">"forced"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"none"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">22</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [ ],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">22</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestExplainValid_container_collapse" onclick="$('#RestExplainValid_long').hide(); $('#RestExplainValid_short').show(); window.location.hash='RestExplainValid_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainValid_short" onclick="$('#RestExplainValid_short').hide(); $('#RestExplainValid_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products RETURN p"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
A plan with some optimizer rules applied
<div class="example-container" id="RestExplainOptimizerRules_container">
<a class="anchorjs-link " href="#RestExplainOptimizerRules_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainOptimizerRules_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LET a = p.id FILTER a == 4 LET name = p.name SORT p.id LIMIT 1 RETURN name"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">11</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">4.3719280948873624</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
},
<span class="hljs-string">"projections"</span> : [
<span class="hljs-string">"name"</span>,
<span class="hljs-string">"id"</span>
],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"70066"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074264813570"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"id"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"id"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">11</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">5.3719280948873624</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"id"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"FilterNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">6.3719280948873624</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"LimitNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">7.3719280948873624</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"fullCount"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">9</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">8.371928094887362</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">9.371928094887362</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"remove-redundant-calculations"</span>,
<span class="hljs-string">"remove-unnecessary-calculations"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>,
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"use-index-for-sort"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>,
<span class="hljs-string">"move-calculations-down"</span>,
<span class="hljs-string">"reduce-extraction-to-projection"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"a"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">9.371928094887362</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestExplainOptimizerRules_container_collapse" onclick="$('#RestExplainOptimizerRules_long').hide(); $('#RestExplainOptimizerRules_short').show(); window.location.hash='RestExplainOptimizerRules_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainOptimizerRules_short" onclick="$('#RestExplainOptimizerRules_short').hide(); $('#RestExplainOptimizerRules_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LET a = p.id FILTER a == 4 LET name = p.name SORT p.id LIMIT 1 RETURN name"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Using some options
<div class="example-container" id="RestExplainOptions_container">
<a class="anchorjs-link " href="#RestExplainOptions_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainOptions_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LET a = p.id FILTER a == 4 LET name = p.name SORT p.id LIMIT 1 RETURN name"</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"maxNumberOfPlans"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"allPlans"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"optimizer"</span> : {
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"-all"</span>,
<span class="hljs-string">"+use-index-for-sort"</span>,
<span class="hljs-string">"+use-index-range"</span>
]
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"plans"</span> : [
{
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">11</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">11</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"70098"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074276347906"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"id"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">11</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">21</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"id"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"a"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">31</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"a"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"FilterNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">41</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">5</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">51</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">61</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"id"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"attribute"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"LimitNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">7</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"offset"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"fullCount"</span> : <span class="hljs-literal">false</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">9</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"use-index-for-sort"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"5"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"name"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"a"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
}
],
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">33</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestExplainOptions_container_collapse" onclick="$('#RestExplainOptions_long').hide(); $('#RestExplainOptions_short').show(); window.location.hash='RestExplainOptions_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainOptions_short" onclick="$('#RestExplainOptions_short').hide(); $('#RestExplainOptions_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products LET a = p.id FILTER a == 4 LET name = p.name SORT p.id LIMIT 1 RETURN name"</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"maxNumberOfPlans"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"allPlans"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"optimizer"</span> : {
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"-all"</span>,
<span class="hljs-string">"+use-index-for-sort"</span>,
<span class="hljs-string">"+use-index-range"</span>
]
}
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Returning all plans
<div class="example-container" id="RestExplainAllPlans_container">
<a class="anchorjs-link " href="#RestExplainAllPlans_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainAllPlans_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products FILTER p.id == 25 RETURN p"</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"allPlans"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"plans"</span> : [
{
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"IndexNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
},
<span class="hljs-string">"projections"</span> : [ ],
<span class="hljs-string">"producesResult"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"satellite"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"needsGatherNodeSort"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexCoversProjections"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"70039"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382074246987776"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"id"</span>
],
<span class="hljs-string">"selectivityEstimate"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"condition"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary or"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">63</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"n-ary and"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">62</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"compare =="</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"excludesNull"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"attribute access"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">35</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"id"</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"reference"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">45</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>
}
]
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">25</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
}
]
}
]
},
<span class="hljs-string">"sorted"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"ascending"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"reverse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"evalFCalls"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"limit"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">6</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"use-indexes"</span>,
<span class="hljs-string">"remove-filter-covered-by-index"</span>,
<span class="hljs-string">"remove-unnecessary-calculations-2"</span>
],
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"products"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"read"</span>
}
],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"p"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
}
],
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestExplainAllPlans_container_collapse" onclick="$('#RestExplainAllPlans_long').hide(); $('#RestExplainAllPlans_short').show(); window.location.hash='RestExplainAllPlans_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainAllPlans_short" onclick="$('#RestExplainAllPlans_short').hide(); $('#RestExplainAllPlans_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products FILTER p.id == 25 RETURN p"</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"allPlans"</span> : <span class="hljs-literal">true</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
A query that produces a warning
<div class="example-container" id="RestExplainWarning_container">
<a class="anchorjs-link " href="#RestExplainWarning_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainWarning_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..10 RETURN 1 / 0"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"range"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">49</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"simple"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"null"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"json"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateListNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">13</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">23</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [
<span class="hljs-string">"move-calculations-up"</span>,
<span class="hljs-string">"move-calculations-up-2"</span>
],
<span class="hljs-string">"collections"</span> : [ ],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"3"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">23</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"warnings"</span> : [
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">1562</span>,
<span class="hljs-string">"message"</span> : <span class="hljs-string">"division by zero"</span>
}
],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestExplainWarning_container_collapse" onclick="$('#RestExplainWarning_long').hide(); $('#RestExplainWarning_short').show(); window.location.hash='RestExplainWarning_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainWarning_short" onclick="$('#RestExplainWarning_short').hide(); $('#RestExplainWarning_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR i IN 1..10 RETURN 1 / 0"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Invalid query (missing bind parameter)
<div class="example-container" id="RestExplainInvalid_container">
<a class="anchorjs-link " href="#RestExplainInvalid_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainInvalid_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"no value specified for declared bind parameter 'id' (while parsing)"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1551</span>
}
</pre>
<div id="RestExplainInvalid_container_collapse" onclick="$('#RestExplainInvalid_long').hide(); $('#RestExplainInvalid_short').show(); window.location.hash='RestExplainInvalid_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainInvalid_short" onclick="$('#RestExplainInvalid_short').hide(); $('#RestExplainInvalid_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{
<span class="hljs-string">"query"</span> : <span class="hljs-string">"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
The data returned in the **plan** attribute of the result contains one element per AQL top-level statement
(i.e. `FOR`, `RETURN`, `FILTER` etc.). If the query optimizer removed some unnecessary statements,
the result might also contain less elements than there were top-level statements in the AQL query.
The following example shows a query with a non-sensible filter condition that
the optimizer has removed so that there are less top-level statements.
<div class="example-container" id="RestExplainEmpty_container">
<a class="anchorjs-link " href="#RestExplainEmpty_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestExplainEmpty_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{ "query" : "FOR i IN [ 1, 2, 3 ] FILTER 1 == 2 RETURN i" }
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"plan"</span> : {
<span class="hljs-string">"nodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"SingletonNode"</span>,
<span class="hljs-string">"dependencies"</span> : [ ],
<span class="hljs-string">"id"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"CalculationNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">1</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"expression"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"array"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">41</span>,
<span class="hljs-string">"subNodes"</span> : [
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"value"</span>,
<span class="hljs-string">"typeID"</span> : <span class="hljs-number">40</span>,
<span class="hljs-string">"value"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"vType"</span> : <span class="hljs-string">"int"</span>,
<span class="hljs-string">"vTypeID"</span> : <span class="hljs-number">2</span>
}
]
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"canThrow"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"expressionType"</span> : <span class="hljs-string">"json"</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"EnumerateListNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">2</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
<span class="hljs-string">"outVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"NoResultsNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">3</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">4</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">0.5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">0</span>
},
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"ReturnNode"</span>,
<span class="hljs-string">"dependencies"</span> : [
<span class="hljs-number">4</span>
],
<span class="hljs-string">"id"</span> : <span class="hljs-number">5</span>,
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">0.5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"inVariable"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
},
<span class="hljs-string">"count"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"rules"</span> : [ ],
<span class="hljs-string">"collections"</span> : [ ],
<span class="hljs-string">"variables"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"1"</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"i"</span>
}
],
<span class="hljs-string">"estimatedCost"</span> : <span class="hljs-number">0.5</span>,
<span class="hljs-string">"estimatedNrItems"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"initialize"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isModificationQuery"</span> : <span class="hljs-literal">false</span>
},
<span class="hljs-string">"cacheable"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"warnings"</span> : [ ],
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"rulesExecuted"</span> : <span class="hljs-number">36</span>,
<span class="hljs-string">"rulesSkipped"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"plansCreated"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>
}
</pre>
<div id="RestExplainEmpty_container_collapse" onclick="$('#RestExplainEmpty_long').hide(); $('#RestExplainEmpty_short').show(); window.location.hash='RestExplainEmpty_container';" class="example_show_button">Hide response body</div></div>
<div id="RestExplainEmpty_short" onclick="$('#RestExplainEmpty_short').hide(); $('#RestExplainEmpty_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/explain</span> &lt;&lt;EOF
{ "query" : "FOR i IN [ 1, 2, 3 ] FILTER 1 == 2 RETURN i" }
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/DeleteApiQueryKill.md -->
@startDocuBlock DeleteApiQueryKill
@brief kills an AQL query
@RESTHEADER{DELETE /_api/query/{query-id}, Kills a running AQL query, deleteQuery}
@RESTURLPARAMETERS
@RESTURLPARAM{query-id,string,required}
The id of the query.
@RESTDESCRIPTION
Kills a running query. The query will be terminated at the next cancelation
point.
@RESTRETURNCODES
@RESTRETURNCODE{200}
The server will respond with *HTTP 200* when the query was still running when
the kill request was executed and the query's kill flag was set.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request.
@RESTRETURNCODE{404}
The server will respond with *HTTP 404* when no query with the specified
id was found.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/GetApiQuerySlow.md -->
@startDocuBlock GetApiQuerySlow
@brief returns a list of slow running AQL queries
@RESTHEADER{GET /_api/query/slow, Returns the list of slow AQL queries, readQuery:Slow}
@RESTDESCRIPTION
Returns an array containing the last AQL queries that are finished and
have exceeded the slow query threshold in the selected database.
The maximum amount of queries in the list can be controlled by setting
the query tracking property `maxSlowQueries`. The threshold for treating
a query as *slow* can be adjusted by setting the query tracking property
`slowQueryThreshold`.
Each query is a JSON object with the following attributes:
- *id*: the query's id
- *query*: the query string (potentially truncated)
- *bindVars*: the bind parameter values used by the query
- *started*: the date and time when the query was started
- *runTime*: the query's total run time
- *state*: the query's current execution state (will always be "finished"
for the list of slow queries)
- *stream*: whether or not the query uses a streaming cursor
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned when the list of queries can be retrieved successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/post_api_aqlfunction.md -->
@startDocuBlock post_api_aqlfunction
@brief create a new AQL user function
@RESTHEADER{POST /_api/aqlfunction, Create AQL user function, RestAqlUserFunctionsHandler:create}
@RESTBODYPARAM{name,string,required,string}
the fully qualified name of the user functions.
@RESTBODYPARAM{code,string,required,string}
a string representation of the function body.
@RESTBODYPARAM{isDeterministic,boolean,optional,}
an optional boolean value to indicate whether the function
results are fully deterministic (function return value solely depends on
the input value and return value is the same for repeated calls with same
input). The *isDeterministic* attribute is currently not used but may be
used later for optimizations.
@RESTDESCRIPTION
In case of success, HTTP 200 is returned.
If the function isn't valid etc. HTTP 400 including a detailed error message will be returned.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the function already existed and was replaced by the
call, the server will respond with *HTTP 200*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{isNewlyCreated,boolean,required,}
boolean flag to indicate whether the function was newly created (*false* in this case)
@RESTRETURNCODE{201}
If the function can be registered by the server, the server will respond with
*HTTP 201*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{isNewlyCreated,boolean,required,}
boolean flag to indicate whether the function was newly created (*true* in this case)
@RESTRETURNCODE{400}
If the JSON representation is malformed or mandatory data is missing from the
request, the server will respond with *HTTP 400*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*true* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{errorNum,integer,required,int64}
the server error number
@RESTREPLYBODY{errorMessage,string,required,string}
a descriptive error message
@EXAMPLES
<div class="example-container" id="RestAqlfunctionCreate_container">
<a class="anchorjs-link " href="#RestAqlfunctionCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAqlfunctionCreate_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/aqlfunction</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myfunctions::temperature::celsiustofahrenheit"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"function (celsius) { return celsius * 1.8 + 32; }"</span>,
<span class="hljs-string">"isDeterministic"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>,
<span class="hljs-string">"isNewlyCreated"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestAqlfunctionCreate_container_collapse" onclick="$('#RestAqlfunctionCreate_long').hide(); $('#RestAqlfunctionCreate_short').show(); window.location.hash='RestAqlfunctionCreate_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAqlfunctionCreate_short" onclick="$('#RestAqlfunctionCreate_short').hide(); $('#RestAqlfunctionCreate_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/aqlfunction</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myfunctions::temperature::celsiustofahrenheit"</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-string">"function (celsius) { return celsius * 1.8 + 32; }"</span>,
<span class="hljs-string">"isDeterministic"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/DeleteApiQueryCache.md -->
@startDocuBlock DeleteApiQueryCache
@brief clears the AQL query results cache
@RESTHEADER{DELETE /_api/query-cache, Clears any results in the AQL query results cache, clearCache}
@RESTDESCRIPTION
clears the query results cache for the current database
@RESTRETURNCODES
@RESTRETURNCODE{200}
The server will respond with *HTTP 200* when the cache was cleared
successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/GetApiQueryCacheCurrent.md -->
@startDocuBlock GetApiQueryCacheCurrent
@brief returns a list of the stored results in the AQL query results cache
@RESTHEADER{GET /_api/query-cache/entries, Returns the currently cached query results, readQueries}
@RESTDESCRIPTION
Returns an array containing the AQL query results currently stored in the query results
cache of the selected database. Each result is a JSON object with the following attributes:
- *hash*: the query result's hash
- *query*: the query string
- *bindVars*: the query's bind parameters. this attribute is only shown if tracking for
bind variables was enabled at server start
- *size*: the size of the query result and bind parameters, in bytes
- *results*: number of documents/rows in the query result
- *started*: the date and time when the query was stored in the cache
- *hits*: number of times the result was served from the cache (can be
*0* for queries that were only stored in the cache but were never accessed
again afterwards)
- *runTime*: the query's run time
- *dataSources*: an array of collections/views the query was using
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned when the list of results can be retrieved successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/PutApiQueryProperties.md -->
@startDocuBlock PutApiQueryProperties
@brief changes the configuration for the AQL query tracking
@RESTHEADER{PUT /_api/query/properties, Changes the properties for the AQL query tracking, replaceProperties}
@RESTBODYPARAM{enabled,boolean,required,}
If set to *true*, then queries will be tracked. If set to
*false*, neither queries nor slow queries will be tracked.
@RESTBODYPARAM{trackSlowQueries,boolean,required,}
If set to *true*, then slow queries will be tracked
in the list of slow queries if their runtime exceeds the value set in
*slowQueryThreshold*. In order for slow queries to be tracked, the *enabled*
property must also be set to *true*.
@RESTBODYPARAM{trackBindVars,boolean,required,}
If set to *true*, then the bind variables used in queries will be tracked
along with queries.
@RESTBODYPARAM{maxSlowQueries,integer,required,int64}
The maximum number of slow queries to keep in the list
of slow queries. If the list of slow queries is full, the oldest entry in
it will be discarded when additional slow queries occur.
@RESTBODYPARAM{slowQueryThreshold,integer,required,int64}
The threshold value for treating a query as slow. A
query with a runtime greater or equal to this threshold value will be
put into the list of slow queries when slow query tracking is enabled.
The value for *slowQueryThreshold* is specified in seconds.
@RESTBODYPARAM{maxQueryStringLength,integer,required,int64}
The maximum query string length to keep in the list of queries.
Query strings can have arbitrary lengths, and this property
can be used to save memory in case very long query strings are used. The
value is specified in bytes.
@RESTDESCRIPTION
The properties need to be passed in the attribute *properties* in the body
of the HTTP request. *properties* needs to be a JSON object.
After the properties have been changed, the current set of properties will
be returned in the HTTP response.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the properties were changed successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/get_api_aqlfunction.md -->
@startDocuBlock get_api_aqlfunction
@brief gets all reqistered AQL user functions
@RESTHEADER{GET /_api/aqlfunction, Return registered AQL user functions, RestAqlUserFunctionsHandler:List}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{namespace,string,optional}
Returns all registered AQL user functions from namespace *namespace* under *result*.
@RESTDESCRIPTION
Returns all registered AQL user functions.
The call will return a JSON array with status codes and all user functions found under *result*.
@RESTRETURNCODES
@RESTRETURNCODE{200}
on success *HTTP 200* is returned.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{result,array,required,aql_userfunction_struct}
All functions, or the ones matching the *namespace* parameter
@RESTSTRUCT{name,aql_userfunction_struct,string,required,}
The fully qualified name of the user function
@RESTSTRUCT{code,aql_userfunction_struct,string,required,}
A string representation of the function body
@RESTSTRUCT{isDeterministic,aql_userfunction_struct,boolean,required,}
an optional boolean value to indicate whether the function
results are fully deterministic (function return value solely depends on
the input value and return value is the same for repeated calls with same
input). The *isDeterministic* attribute is currently not used but may be
used later for optimizations.
@RESTRETURNCODE{400}
If the user function name is malformed, the server will respond with *HTTP 400*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*true* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{errorNum,integer,required,int64}
the server error number
@RESTREPLYBODY{errorMessage,string,required,string}
a descriptive error message
@EXAMPLES
<div class="example-container" id="RestAqlfunctionsGetAll_container">
<a class="anchorjs-link " href="#RestAqlfunctionsGetAll_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAqlfunctionsGetAll_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/<span class="hljs-built_in">test</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [ ]
}
</pre>
<div id="RestAqlfunctionsGetAll_container_collapse" onclick="$('#RestAqlfunctionsGetAll_long').hide(); $('#RestAqlfunctionsGetAll_short').show(); window.location.hash='RestAqlfunctionsGetAll_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAqlfunctionsGetAll_short" onclick="$('#RestAqlfunctionsGetAll_short').hide(); $('#RestAqlfunctionsGetAll_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/<span class="hljs-built_in">test</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/delete_api_aqlfunction.md -->
@startDocuBlock delete_api_aqlfunction
@brief remove an existing AQL user function
@RESTHEADER{DELETE /_api/aqlfunction/{name}, Remove existing AQL user function, RestAqlUserFunctionsHandler:Remove}
@RESTURLPARAMETERS
@RESTURLPARAM{name,string,required}
the name of the AQL user function.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{group,string,optional}
- *true*: The function name provided in *name* is treated as
a namespace prefix, and all functions in the specified namespace will be deleted.
The returned number of deleted functions may become 0 if none matches the string.
- *false*: The function name provided in *name* must be fully
qualified, including any namespaces. If none matches the *name*, HTTP 404 is returned.
@RESTDESCRIPTION
Removes an existing AQL user function or function group, identified by *name*.
@RESTRETURNCODES
@RESTRETURNCODE{200}
If the function can be removed by the server, the server will respond with
*HTTP 200*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*false* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{deletedCount,integer,required,int64}
The number of deleted user functions, always `1` when `group` is set to *false*.
Any number `>= 0` when `group` is set to *true*
@RESTRETURNCODE{400}
If the user function name is malformed, the server will respond with *HTTP 400*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*true* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{errorNum,integer,required,int64}
the server error number
@RESTREPLYBODY{errorMessage,string,required,string}
a descriptive error message
@RESTRETURNCODE{404}
If the specified user user function does not exist, the server will respond with *HTTP 404*.
@RESTREPLYBODY{error,boolean,required,}
boolean flag to indicate whether an error occurred (*true* in this case)
@RESTREPLYBODY{code,integer,required,int64}
the HTTP status code
@RESTREPLYBODY{errorNum,integer,required,int64}
the server error number
@RESTREPLYBODY{errorMessage,string,required,string}
a descriptive error message
@EXAMPLES
deletes a function:
<div class="example-container" id="RestAqlfunctionDelete_container">
<a class="anchorjs-link " href="#RestAqlfunctionDelete_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAqlfunctionDelete_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/square::x::y</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"deletedCount"</span> : <span class="hljs-number">1</span>
}
</pre>
<div id="RestAqlfunctionDelete_container_collapse" onclick="$('#RestAqlfunctionDelete_long').hide(); $('#RestAqlfunctionDelete_short').show(); window.location.hash='RestAqlfunctionDelete_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAqlfunctionDelete_short" onclick="$('#RestAqlfunctionDelete_short').hide(); $('#RestAqlfunctionDelete_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/square::x::y</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
function not found:
<div class="example-container" id="RestAqlfunctionDeleteFails_container">
<a class="anchorjs-link " href="#RestAqlfunctionDeleteFails_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestAqlfunctionDeleteFails_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/myfunction::x::y</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">404</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"no AQL user function with name 'myfunction::x::y' found"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1582</span>
}
</pre>
<div id="RestAqlfunctionDeleteFails_container_collapse" onclick="$('#RestAqlfunctionDeleteFails_long').hide(); $('#RestAqlfunctionDeleteFails_short').show(); window.location.hash='RestAqlfunctionDeleteFails_container';" class="example_show_button">Hide response body</div></div>
<div id="RestAqlfunctionDeleteFails_short" onclick="$('#RestAqlfunctionDeleteFails_short').hide(); $('#RestAqlfunctionDeleteFails_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/aqlfunction/myfunction::x::y</span>
HTTP/<span class="hljs-number">1.1</span> Not Found
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/GetApiQueryCacheProperties.md -->
@startDocuBlock GetApiQueryCacheProperties
@brief returns the global configuration for the AQL query results cache
@RESTHEADER{GET /_api/query-cache/properties, Returns the global properties for the AQL query results cache, readProperties}
@RESTDESCRIPTION
Returns the global AQL query results cache configuration. The configuration is a
JSON object with the following properties:
- *mode*: the mode the AQL query results cache operates in. The mode is one of the following
values: *off*, *on* or *demand*.
- *maxResults*: the maximum number of query results that will be stored per database-specific
cache.
- *maxResultsSize*: the maximum cumulated size of query results that will be stored per
database-specific cache.
- *maxEntrySize*: the maximum individual result size of queries that will be stored per
database-specific cache.
- *includeSystem*: whether or not results of queries that involve system collections will be
stored in the query results cache.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the properties can be retrieved successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/PutApiQueryCacheProperties.md -->
@startDocuBlock PutApiQueryCacheProperties
@brief changes the configuration for the AQL query results cache
@RESTHEADER{PUT /_api/query-cache/properties, Globally adjusts the AQL query results cache properties, replaceProperties:QueryCache}
@RESTDESCRIPTION
After the properties have been changed, the current set of properties will
be returned in the HTTP response.
Note: changing the properties may invalidate all results in the cache.
The global properties for AQL query cache.
The properties need to be passed in the attribute *properties* in the body
of the HTTP request. *properties* needs to be a JSON object with the following
properties:
@RESTBODYPARAM{mode,string,optional,string}
the mode the AQL query cache should operate in. Possible values are *off*, *on* or *demand*.
@RESTBODYPARAM{maxResults,integer,optional,int64}
the maximum number of query results that will be stored per database-specific cache.
@RESTBODYPARAM{maxResultsSize,integer,optional,int64}
the maximum cumulated size of query results that will be stored per database-specific cache.
@RESTBODYPARAM{maxEntrySize,integer,optional,int64}
the maximum individual size of query results that will be stored per database-specific cache.
@RESTBODYPARAM{includeSystem,boolean,optional,}
whether or not to store results of queries that involve system collections.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the properties were changed successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/GetApiQueryCurrent.md -->
@startDocuBlock GetApiQueryCurrent
@brief returns a list of currently running AQL queries
@RESTHEADER{GET /_api/query/current, Returns the currently running AQL queries, readQuery:current}
@RESTDESCRIPTION
Returns an array containing the AQL queries currently running in the selected
database. Each query is a JSON object with the following attributes:
- *id*: the query's id
- *query*: the query string (potentially truncated)
- *bindVars*: the bind parameter values used by the query
- *started*: the date and time when the query was started
- *runTime*: the query's run time up to the point the list of queries was
queried
- *state*: the query's current execution state (as a string)
- *stream*: whether or not the query uses a streaming cursor
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned when the list of queries can be retrieved successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/AQL/GetApiQueryProperties.md -->
@startDocuBlock GetApiQueryProperties
@brief returns the configuration for the AQL query tracking
@RESTHEADER{GET /_api/query/properties, Returns the properties for the AQL query tracking, readQueryProperties}
@RESTDESCRIPTION
Returns the current query tracking configuration. The configuration is a
JSON object with the following properties:
- *enabled*: if set to *true*, then queries will be tracked. If set to
*false*, neither queries nor slow queries will be tracked.
- *trackSlowQueries*: if set to *true*, then slow queries will be tracked
in the list of slow queries if their runtime exceeds the value set in
*slowQueryThreshold*. In order for slow queries to be tracked, the *enabled*
property must also be set to *true*.
- *trackBindVars*: if set to *true*, then bind variables used in queries will
be tracked.
- *maxSlowQueries*: the maximum number of slow queries to keep in the list
of slow queries. If the list of slow queries is full, the oldest entry in
it will be discarded when additional slow queries occur.
- *slowQueryThreshold*: the threshold value for treating a query as slow. A
query with a runtime greater or equal to this threshold value will be
put into the list of slow queries when slow query tracking is enabled.
The value for *slowQueryThreshold* is specified in seconds.
- *maxQueryStringLength*: the maximum query string length to keep in the
list of queries. Query strings can have arbitrary lengths, and this property
can be used to save memory in case very long query strings are used. The
value is specified in bytes.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if properties were retrieved successfully.
@RESTRETURNCODE{400}
The server will respond with *HTTP 400* in case of a malformed request,
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph Edges/get_read_in_out_edges.md -->
@startDocuBlock get_read_in_out_edges
@brief get edges
@RESTHEADER{GET /_api/edges/{collection-id}, Read in- or outbound edges}
@RESTURLPARAMETERS
@RESTURLPARAM{collection-id,string,required}
The id of the collection.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{vertex,string,required}
The id of the start vertex.
@RESTQUERYPARAM{direction,string,optional}
Selects *in* or *out* direction for edges. If not set, any edges are
returned.
@RESTDESCRIPTION
Returns an array of edges starting or ending in the vertex identified by
*vertex-handle*.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the edge collection was found and edges were retrieved.
@RESTRETURNCODE{400}
is returned if the request contains invalid parameters.
@RESTRETURNCODE{404}
is returned if the edge collection was not found.
@EXAMPLES
Any direction
<div class="example-container" id="RestEdgesReadEdgesAny_container">
<a class="anchorjs-link " href="#RestEdgesReadEdgesAny_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestEdgesReadEdgesAny_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/6"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertices/2"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertices/1"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WIq--A"</span>,
<span class="hljs-string">"$label"</span> : <span class="hljs-string">"v2 -&gt; v1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"7"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/7"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertices/4"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertices/1"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WIq--C"</span>,
<span class="hljs-string">"$label"</span> : <span class="hljs-string">"v4 -&gt; v1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"5"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/5"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertices/1"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertices/3"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WIq---"</span>,
<span class="hljs-string">"$label"</span> : <span class="hljs-string">"v1 -&gt; v3"</span>
}
],
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>
}
}
</pre>
<div id="RestEdgesReadEdgesAny_container_collapse" onclick="$('#RestEdgesReadEdgesAny_long').hide(); $('#RestEdgesReadEdgesAny_short').show(); window.location.hash='RestEdgesReadEdgesAny_container';" class="example_show_button">Hide response body</div></div>
<div id="RestEdgesReadEdgesAny_short" onclick="$('#RestEdgesReadEdgesAny_short').hide(); $('#RestEdgesReadEdgesAny_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
In edges
<div class="example-container" id="RestEdgesReadEdgesIn_container">
<a class="anchorjs-link " href="#RestEdgesReadEdgesIn_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestEdgesReadEdgesIn_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&amp;direction=<span class="hljs-keyword">in</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/6"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertices/2"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertices/1"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WJC--G"</span>,
<span class="hljs-string">"$label"</span> : <span class="hljs-string">"v2 -&gt; v1"</span>
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"7"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/7"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertices/4"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertices/1"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WJG---"</span>,
<span class="hljs-string">"$label"</span> : <span class="hljs-string">"v4 -&gt; v1"</span>
}
],
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>
}
}
</pre>
<div id="RestEdgesReadEdgesIn_container_collapse" onclick="$('#RestEdgesReadEdgesIn_long').hide(); $('#RestEdgesReadEdgesIn_short').show(); window.location.hash='RestEdgesReadEdgesIn_container';" class="example_show_button">Hide response body</div></div>
<div id="RestEdgesReadEdgesIn_short" onclick="$('#RestEdgesReadEdgesIn_short').hide(); $('#RestEdgesReadEdgesIn_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&amp;direction=<span class="hljs-keyword">in</span></span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Out edges
<div class="example-container" id="RestEdgesReadEdgesOut_container">
<a class="anchorjs-link " href="#RestEdgesReadEdgesOut_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestEdgesReadEdgesOut_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&amp;direction=out</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"edges"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"5"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"edges/5"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"vertices/1"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"vertices/3"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6WJa--E"</span>,
<span class="hljs-string">"$label"</span> : <span class="hljs-string">"v1 -&gt; v3"</span>
}
],
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"stats"</span> : {
<span class="hljs-string">"scannedIndex"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"filtered"</span> : <span class="hljs-number">0</span>
}
}
</pre>
<div id="RestEdgesReadEdgesOut_container_collapse" onclick="$('#RestEdgesReadEdgesOut_long').hide(); $('#RestEdgesReadEdgesOut_short').show(); window.location.hash='RestEdgesReadEdgesOut_container';" class="example_show_button">Hide response body</div></div>
<div id="RestEdgesReadEdgesOut_short" onclick="$('#RestEdgesReadEdgesOut_short').hide(); $('#RestEdgesReadEdgesOut_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/edges/edges?vertex=vertices/1&amp;direction=out</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_development_enable.md -->
@startDocuBlock api_foxx_development_enable
@brief enable development mode
@RESTHEADER{POST /_api/foxx/development, Enable development mode}
@RESTDESCRIPTION
Puts the service into development mode.
While the service is running in development mode the service will be reloaded
from the filesystem and its setup script (if any) will be re-executed every
time the service handles a request.
When running ArangoDB in a cluster with multiple coordinators note that changes
to the filesystem on one coordinator will not be reflected across the other
coordinators. This means you should treat your coordinators as inconsistent
as long as any service is running in development mode.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_service_list.md -->
@startDocuBlock api_foxx_service_list
@brief list installed services
@RESTHEADER{GET /_api/foxx, List installed services}
@RESTDESCRIPTION
Fetches a list of services installed in the current database.
Returns a list of objects with the following attributes:
- *mount*: the mount path of the service
- *development*: *true* if the service is running in development mode
- *legacy*: *true* if the service is running in 2.8 legacy compatibility mode
- *provides*: the service manifest's *provides* value or an empty object
Additionally the object may contain the following attributes if they have been set on the manifest:
- *name*: a string identifying the service type
- *version*: a semver-compatible version string
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{excludeSystem,boolean,optional}
Whether or not system services should be excluded from the result.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_service_details.md -->
@startDocuBlock api_foxx_service_details
@brief service metadata
@RESTHEADER{GET /_api/foxx/service, Service description}
@RESTDESCRIPTION
Fetches detailed information for the service at the given mount path.
Returns an object with the following attributes:
- *mount*: the mount path of the service
- *path*: the local file system path of the service
- *development*: *true* if the service is running in development mode
- *legacy*: *true* if the service is running in 2.8 legacy compatibility mode
- *manifest*: the normalized JSON manifest of the service
Additionally the object may contain the following attributes if they have been set on the manifest:
- *name*: a string identifying the service type
- *version*: a semver-compatible version string
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@RESTRETURNCODE{400}
Returned if the mount path is unknown.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_development_disable.md -->
@startDocuBlock api_foxx_development_disable
@brief disable development mode
@RESTHEADER{DELETE /_api/foxx/development, Disable development mode}
@RESTDESCRIPTION
Puts the service at the given mount path into production mode.
When running ArangoDB in a cluster with multiple coordinators this will
replace the service on all other coordinators with the version on this
coordinator.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_dependencies_get.md -->
@startDocuBlock api_foxx_dependencies_get
@brief get dependency options
@RESTHEADER{GET /_api/foxx/dependencies, Get dependency options}
@RESTDESCRIPTION
Fetches the current dependencies for service at the given mount path.
Returns an object mapping the dependency names to their definitions
including a human-friendly *title* and the *current* mount path (if any).
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_service_uninstall.md -->
@startDocuBlock api_foxx_service_uninstall
@brief uninstall service
@RESTHEADER{DELETE /_api/foxx/service, Uninstall service}
@RESTDESCRIPTION
Removes the service at the given mount path from the database and file system.
Returns an empty response on success.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTQUERYPARAM{teardown,boolean,optional}
Set to `false` to not run the service's teardown script.
@RESTRETURNCODES
@RESTRETURNCODE{204}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_dependencies_replace.md -->
@startDocuBlock api_foxx_dependencies_replace
@brief replace dependencies options
@RESTHEADER{PUT /_api/foxx/dependencies, Replace dependencies options}
@RESTDESCRIPTION
Replaces the given service's dependencies completely.
Returns an object mapping all dependency names to their new mount paths.
@RESTALLBODYPARAM{data,json,required}
A JSON object mapping dependency names to their new mount paths.
Any omitted dependencies will be disabled.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_bundle.md -->
@startDocuBlock api_foxx_bundle
@brief download service bundle
@RESTHEADER{POST /_api/foxx/download, Download service bundle}
@RESTDESCRIPTION
Downloads a zip bundle of the service directory.
When development mode is enabled, this always creates a new bundle.
Otherwise the bundle will represent the version of a service that
is installed on that ArangoDB instance.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@RESTRETURNCODE{400}
Returned if the mount path is unknown.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_configuration_update.md -->
@startDocuBlock api_foxx_configuration_update
@brief update configuration options
@RESTHEADER{PATCH /_api/foxx/configuration, Update configuration options}
@RESTDESCRIPTION
Replaces the given service's configuration.
Returns an object mapping all configuration option names to their new values.
@RESTALLBODYPARAM{data,json,required}
A JSON object mapping configuration option names to their new values.
Any omitted options will be ignored.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_service_replace.md -->
@startDocuBlock api_foxx_service_replace
@brief replace a service
@RESTHEADER{PUT /_api/foxx/service, Replace service}
@RESTDESCRIPTION
Removes the service at the given mount path from the database and file system.
Then installs the given new service at the same mount path.
This is a slightly safer equivalent to performing an uninstall of the old service
followed by installing the new service. The new service's main and script files
(if any) will be checked for basic syntax errors before the old service is removed.
The request body can be any of the following formats:
- `application/zip`: a raw zip bundle containing a service
- `application/javascript`: a standalone JavaScript file
- `application/json`: a service definition as JSON
- `multipart/form-data`: a service definition as a multipart form
A service definition is an object or form with the following properties or fields:
- *configuration*: a JSON object describing configuration values
- *dependencies*: a JSON object describing dependency settings
- *source*: a fully qualified URL or an absolute path on the server's file system
When using multipart data, the *source* field can also alternatively be a file field
containing either a zip bundle or a standalone JavaScript file.
When using a standalone JavaScript file the given file will be executed
to define our service's HTTP endpoints. It is the same which would be defined
in the field `main` of the service manifest.
If *source* is a URL, the URL must be reachable from the server.
If *source* is a file system path, the path will be resolved on the server.
In either case the path or URL is expected to resolve to a zip bundle,
JavaScript file or (in case of a file system path) directory.
Note that when using file system paths in a cluster with multiple coordinators
the file system path must resolve to equivalent files on every coordinator.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTQUERYPARAM{teardown,boolean,optional}
Set to `false` to not run the old service's teardown script.
@RESTQUERYPARAM{setup,boolean,optional}
Set to `false` to not run the new service's setup script.
@RESTQUERYPARAM{legacy,boolean,optional}
Set to `true` to install the new service in 2.8 legacy compatibility mode.
@RESTQUERYPARAM{force,boolean,optional}
Set to `true` to force service install even if no service is installed under given mount.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_readme.md -->
@startDocuBlock api_foxx_readme
@brief service README
@RESTHEADER{GET /_api/foxx/readme, Service README}
@RESTDESCRIPTION
Fetches the service's README or README.md file's contents if any.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@RESTRETURNCODE{204}
Returned if no README file was found.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_commit.md -->
@startDocuBlock api_foxx_commit
@brief commit local service state
@RESTHEADER{POST /_api/foxx/commit, Commit local service state}
@RESTDESCRIPTION
Commits the local service state of the coordinator to the database.
This can be used to resolve service conflicts between coordinators that can not be fixed automatically due to missing data.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{replace,boolean,optional}
Overwrite existing service files in database even if they already exist.
@RESTRETURNCODE{204}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_scripts_run.md -->
@startDocuBlock api_foxx_scripts_run
@brief run service script
@RESTHEADER{POST /_api/foxx/scripts/{name}, Run service script}
@RESTALLBODYPARAM{data,json,optional}
An arbitrary JSON value that will be parsed and passed to the
script as its first argument.
@RESTURLPARAMETERS
@RESTURLPARAM{name,string,required}
Name of the script to run.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTDESCRIPTION
Runs the given script for the service at the given mount path.
Returns the exports of the script, if any.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_tests_run.md -->
@startDocuBlock api_foxx_tests_run
@brief run service tests
@RESTHEADER{POST /_api/foxx/tests, Run service tests}
@RESTDESCRIPTION
Runs the tests for the service at the given mount path and returns the results.
Supported test reporters are:
- *default*: a simple list of test cases
- *suite*: an object of test cases nested in suites
- *stream*: a raw stream of test results
- *xunit*: an XUnit/JUnit compatible structure
- *tap*: a raw TAP compatible stream
The *Accept* request header can be used to further control the response format:
When using the *stream* reporter `application/x-ldjson` will result
in the response body being formatted as a newline-delimited JSON stream.
When using the *tap* reporter `text/plain` or `text/*` will result
in the response body being formatted as a plain text TAP report.
When using the *xunit* reporter `application/xml` or `text/xml` will result
in the response body being formatted as XML instead of JSONML.
Otherwise the response body will be formatted as non-prettyprinted JSON.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTQUERYPARAM{reporter,string,optional}
Test reporter to use.
@RESTQUERYPARAM{idiomatic,boolean,optional}
Use the matching format for the reporter, regardless of the *Accept* header.
@RESTQUERYPARAM{filter,string,optional}
Only run tests where the full name (including full test suites and test case)
matches this string.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_dependencies_update.md -->
@startDocuBlock api_foxx_dependencies_update
@brief update dependencies options
@RESTHEADER{PATCH /_api/foxx/dependencies, Update dependencies options}
@RESTDESCRIPTION
Replaces the given service's dependencies.
Returns an object mapping all dependency names to their new mount paths.
@RESTALLBODYPARAM{data,json,required}
A JSON object mapping dependency names to their new mount paths.
Any omitted dependencies will be ignored.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_configuration_replace.md -->
@startDocuBlock api_foxx_configuration_replace
@brief replace configuration options
@RESTHEADER{PUT /_api/foxx/configuration, Replace configuration options}
@RESTDESCRIPTION
Replaces the given service's configuration completely.
Returns an object mapping all configuration option names to their new values.
@RESTALLBODYPARAM{data,json,required}
A JSON object mapping configuration option names to their new values.
Any omitted options will be reset to their default values or marked as unconfigured.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_service_install.md -->
@startDocuBlock api_foxx_service_install
@brief install new service
@RESTHEADER{POST /_api/foxx, Install new service}
@RESTDESCRIPTION
Installs the given new service at the given mount path.
The request body can be any of the following formats:
- `application/zip`: a raw zip bundle containing a service
- `application/javascript`: a standalone JavaScript file
- `application/json`: a service definition as JSON
- `multipart/form-data`: a service definition as a multipart form
A service definition is an object or form with the following properties or fields:
- *configuration*: a JSON object describing configuration values
- *dependencies*: a JSON object describing dependency settings
- *source*: a fully qualified URL or an absolute path on the server's file system
When using multipart data, the *source* field can also alternatively be a file field
containing either a zip bundle or a standalone JavaScript file.
When using a standalone JavaScript file the given file will be executed
to define our service's HTTP endpoints. It is the same which would be defined
in the field `main` of the service manifest.
If *source* is a URL, the URL must be reachable from the server.
If *source* is a file system path, the path will be resolved on the server.
In either case the path or URL is expected to resolve to a zip bundle,
JavaScript file or (in case of a file system path) directory.
Note that when using file system paths in a cluster with multiple coordinators
the file system path must resolve to equivalent files on every coordinator.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path the service should be installed at.
@RESTQUERYPARAM{development,boolean,optional}
Set to `true` to enable development mode.
@RESTQUERYPARAM{setup,boolean,optional}
Set to `false` to not run the service's setup script.
@RESTQUERYPARAM{legacy,boolean,optional}
Set to `true` to install the service in 2.8 legacy compatibility mode.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_configuration_get.md -->
@startDocuBlock api_foxx_configuration_get
@brief get configuration options
@RESTHEADER{GET /_api/foxx/configuration, Get configuration options}
@RESTDESCRIPTION
Fetches the current configuration for the service at the given mount path.
Returns an object mapping the configuration option names to their definitions
including a human-friendly *title* and the *current* value (if any).
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_scripts_list.md -->
@startDocuBlock api_foxx_scripts_list
@brief list service scripts
@RESTHEADER{GET /_api/foxx/scripts, List service scripts}
@RESTDESCRIPTION
Fetches a list of the scripts defined by the service.
Returns an object mapping the raw script names to human-friendly names.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_service_upgrade.md -->
@startDocuBlock api_foxx_service_upgrade
@brief upgrade a service
@RESTHEADER{PATCH /_api/foxx/service, Upgrade service}
@RESTDESCRIPTION
Installs the given new service on top of the service currently installed at the given mount path.
This is only recommended for switching between different versions of the same service.
Unlike replacing a service, upgrading a service retains the old service's configuration
and dependencies (if any) and should therefore only be used to migrate an existing service
to a newer or equivalent service.
The request body can be any of the following formats:
- `application/zip`: a raw zip bundle containing a service
- `application/javascript`: a standalone JavaScript file
- `application/json`: a service definition as JSON
- `multipart/form-data`: a service definition as a multipart form
A service definition is an object or form with the following properties or fields:
- *configuration*: a JSON object describing configuration values
- *dependencies*: a JSON object describing dependency settings
- *source*: a fully qualified URL or an absolute path on the server's file system
When using multipart data, the *source* field can also alternatively be a file field
containing either a zip bundle or a standalone JavaScript file.
When using a standalone JavaScript file the given file will be executed
to define our service's HTTP endpoints. It is the same which would be defined
in the field `main` of the service manifest.
If *source* is a URL, the URL must be reachable from the server.
If *source* is a file system path, the path will be resolved on the server.
In either case the path or URL is expected to resolve to a zip bundle,
JavaScript file or (in case of a file system path) directory.
Note that when using file system paths in a cluster with multiple coordinators
the file system path must resolve to equivalent files on every coordinator.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTQUERYPARAM{teardown,boolean,optional}
Set to `true` to run the old service's teardown script.
@RESTQUERYPARAM{setup,boolean,optional}
Set to `false` to not run the new service's setup script.
@RESTQUERYPARAM{legacy,boolean,optional}
Set to `true` to install the new service in 2.8 legacy compatibility mode.
@RESTQUERYPARAM{force,boolean,optional}
Set to `true` to force service install even if no service is installed under given mount.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Foxx/api_foxx_swagger.md -->
@startDocuBlock api_foxx_swagger
@brief swagger description
@RESTHEADER{GET /_api/foxx/swagger, Swagger description}
@RESTDESCRIPTION
Fetches the Swagger API description for the service at the given mount path.
The response body will be an OpenAPI 2.0 compatible JSON description of the service API.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{mount,string,required}
Mount path of the installed service.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the request was successful.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Database/get_api_database_list.md -->
@startDocuBlock get_api_database_list
@brief retrieves a list of all existing databases
@RESTHEADER{GET /_api/database, List of databases, getDatabases:all}
@RESTDESCRIPTION
Retrieves the list of all existing databases
**Note**: retrieving the list of databases is only possible from within the *_system* database.
**Note**: You should use the [*GET user API*](../UserManagement/README.md#list-the-accessible-databases-for-a-user) to fetch the list of the available databases now.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the list of database was compiled successfully.
@RESTRETURNCODE{400}
is returned if the request is invalid.
@RESTRETURNCODE{403}
is returned if the request was not executed in the *_system* database.
@EXAMPLES
<div class="example-container" id="RestDatabaseGet_container">
<a class="anchorjs-link " href="#RestDatabaseGet_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDatabaseGet_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [
<span class="hljs-string">"_system"</span>
]
}
</pre>
<div id="RestDatabaseGet_container_collapse" onclick="$('#RestDatabaseGet_long').hide(); $('#RestDatabaseGet_short').show(); window.location.hash='RestDatabaseGet_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDatabaseGet_short" onclick="$('#RestDatabaseGet_short').hide(); $('#RestDatabaseGet_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Database/get_api_database_current.md -->
@startDocuBlock get_api_database_current
@brief retrieves information about the current database
@RESTHEADER{GET /_api/database/current, Information of the database, getDatabases:current}
@RESTDESCRIPTION
Retrieves information about the current database
The response is a JSON object with the following attributes:
- *name*: the name of the current database
- *id*: the id of the current database
- *path*: the filesystem path of the current database
- *isSystem*: whether or not the current database is the *_system* database
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the information was retrieved successfully.
@RESTRETURNCODE{400}
is returned if the request is invalid.
@RESTRETURNCODE{404}
is returned if the database could not be found.
@EXAMPLES
<div class="example-container" id="RestDatabaseGetInfo_container">
<a class="anchorjs-link " href="#RestDatabaseGetInfo_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDatabaseGetInfo_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database/current</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : {
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"1"</span>,
<span class="hljs-string">"path"</span> : <span class="hljs-string">"/tmp/arangosh_JLhkMp/rocksdb-clusterOrNot/data"</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>
}
}
</pre>
<div id="RestDatabaseGetInfo_container_collapse" onclick="$('#RestDatabaseGetInfo_long').hide(); $('#RestDatabaseGetInfo_short').show(); window.location.hash='RestDatabaseGetInfo_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDatabaseGetInfo_short" onclick="$('#RestDatabaseGetInfo_short').hide(); $('#RestDatabaseGetInfo_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database/current</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Database/get_api_database_delete.md -->
@startDocuBlock get_api_database_delete
@brief drop an existing database
@RESTHEADER{DELETE /_api/database/{database-name}, Drop database, deleteDatabase}
@RESTURLPARAMETERS
@RESTURLPARAM{database-name,string,required}
The name of the database
@RESTDESCRIPTION
Drops the database along with all data stored in it.
**Note**: dropping a database is only possible from within the *_system* database.
The *_system* database itself cannot be dropped.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the database was dropped successfully.
@RESTRETURNCODE{400}
is returned if the request is malformed.
@RESTRETURNCODE{403}
is returned if the request was not executed in the *_system* database.
@RESTRETURNCODE{404}
is returned if the database could not be found.
@EXAMPLES
<div class="example-container" id="RestDatabaseDrop_container">
<a class="anchorjs-link " href="#RestDatabaseDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDatabaseDrop_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database/example</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestDatabaseDrop_container_collapse" onclick="$('#RestDatabaseDrop_long').hide(); $('#RestDatabaseDrop_short').show(); window.location.hash='RestDatabaseDrop_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDatabaseDrop_short" onclick="$('#RestDatabaseDrop_short').hide(); $('#RestDatabaseDrop_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database/example</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Database/get_api_database_new.md -->
@startDocuBlock get_api_database_new
@brief creates a new database
@RESTHEADER{POST /_api/database, Create database, createDatabase}
@RESTBODYPARAM{name,string,required,string}
Has to contain a valid database name.
@RESTBODYPARAM{users,array,optional,get_api_database_new_USERS}
Has to be an array of user objects to initially create for the new database.
User information will not be changed for users that already exist.
If *users* is not specified or does not contain any users, a default user
*root* will be created with an empty string password. This ensures that the
new database will be accessible after it is created.
Each user object can contain the following attributes:
@RESTSTRUCT{username,get_api_database_new_USERS,string,required,string}
Login name of the user to be created
@RESTSTRUCT{passwd,get_api_database_new_USERS,string,required,string}
The user password as a string. If not specified, it will default to an empty string.
@RESTSTRUCT{active,get_api_database_new_USERS,boolean,required,}
A flag indicating whether the user account should be activated or not.
The default value is *true*. If set to *false*, the user won't be able to
log into the database.
@RESTSTRUCT{extra,get_api_database_new_USERS,object,optional,}
A JSON object with extra user information. The data contained in *extra*
will be stored for the user but not be interpreted further by ArangoDB.
@RESTDESCRIPTION
Creates a new database
The response is a JSON object with the attribute *result* set to *true*.
**Note**: creating a new database is only possible from within the *_system* database.
@RESTRETURNCODES
@RESTRETURNCODE{201}
is returned if the database was created successfully.
@RESTRETURNCODE{400}
is returned if the request parameters are invalid or if a database with the
specified name already exists.
@RESTRETURNCODE{403}
is returned if the request was not executed in the *_system* database.
@RESTRETURNCODE{409}
is returned if a database with the specified name already exists.
@EXAMPLES
Creating a database named *example*.
<div class="example-container" id="RestDatabaseCreate_container">
<a class="anchorjs-link " href="#RestDatabaseCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDatabaseCreate_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/database</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"example"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestDatabaseCreate_container_collapse" onclick="$('#RestDatabaseCreate_long').hide(); $('#RestDatabaseCreate_short').show(); window.location.hash='RestDatabaseCreate_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDatabaseCreate_short" onclick="$('#RestDatabaseCreate_short').hide(); $('#RestDatabaseCreate_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/database</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"example"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Creating a database named *mydb* with two users.
<div class="example-container" id="RestDatabaseCreateUsers_container">
<a class="anchorjs-link " href="#RestDatabaseCreateUsers_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDatabaseCreateUsers_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/database</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"mydb"</span>,
<span class="hljs-string">"users"</span> : [
{
<span class="hljs-string">"username"</span> : <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secret"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"username"</span> : <span class="hljs-string">"tester"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"test001"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">false</span>
}
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">201</span>,
<span class="hljs-string">"result"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="RestDatabaseCreateUsers_container_collapse" onclick="$('#RestDatabaseCreateUsers_long').hide(); $('#RestDatabaseCreateUsers_short').show(); window.location.hash='RestDatabaseCreateUsers_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDatabaseCreateUsers_short" onclick="$('#RestDatabaseCreateUsers_short').hide(); $('#RestDatabaseCreateUsers_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/database</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"mydb"</span>,
<span class="hljs-string">"users"</span> : [
{
<span class="hljs-string">"username"</span> : <span class="hljs-string">"admin"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"secret"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"username"</span> : <span class="hljs-string">"tester"</span>,
<span class="hljs-string">"passwd"</span> : <span class="hljs-string">"test001"</span>,
<span class="hljs-string">"active"</span> : <span class="hljs-literal">false</span>
}
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Created
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Database/get_api_database_user.md -->
@startDocuBlock get_api_database_user
@brief retrieves a list of all databases the current user can access
@RESTHEADER{GET /_api/database/user, List of accessible databases, getDatabases:user}
@RESTDESCRIPTION
Retrieves the list of all databases the current user can access without
specifying a different username or password.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the list of database was compiled successfully.
@RESTRETURNCODE{400}
is returned if the request is invalid.
@EXAMPLES
<div class="example-container" id="RestDatabaseGetUser_container">
<a class="anchorjs-link " href="#RestDatabaseGetUser_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestDatabaseGetUser_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database/user</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"result"</span> : [
<span class="hljs-string">"_system"</span>
]
}
</pre>
<div id="RestDatabaseGetUser_container_collapse" onclick="$('#RestDatabaseGetUser_long').hide(); $('#RestDatabaseGetUser_short').show(); window.location.hash='RestDatabaseGetUser_container';" class="example_show_button">Hide response body</div></div>
<div id="RestDatabaseGetUser_short" onclick="$('#RestDatabaseGetUser_short').hide(); $('#RestDatabaseGetUser_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/database/user</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_applier_adjust.md -->
@startDocuBlock put_api_replication_applier_adjust
@brief set configuration values of an applier
@RESTHEADER{PUT /_api/replication/applier-config, Adjust configuration of replication applier,handleCommandApplierSetConfig}
@RESTBODYPARAM{endpoint,string,required,string}
the logger server to connect to (e.g. "tcp://192.168.173.13:8529"). The endpoint must be specified.
@RESTBODYPARAM{database,string,required,string}
the name of the database on the endpoint. If not specified, defaults to the current local database name.
@RESTBODYPARAM{username,string,optional,string}
an optional ArangoDB username to use when connecting to the endpoint.
@RESTBODYPARAM{password,string,required,string}
the password to use when connecting to the endpoint.
@RESTBODYPARAM{maxConnectRetries,integer,required,int64}
the maximum number of connection attempts the applier
will make in a row. If the applier cannot establish a connection to the
endpoint in this number of attempts, it will stop itself.
@RESTBODYPARAM{connectTimeout,integer,required,int64}
the timeout (in seconds) when attempting to connect to the
endpoint. This value is used for each connection attempt.
@RESTBODYPARAM{requestTimeout,integer,required,int64}
the timeout (in seconds) for individual requests to the endpoint.
@RESTBODYPARAM{chunkSize,integer,required,int64}
the requested maximum size for log transfer packets that
is used when the endpoint is contacted.
@RESTBODYPARAM{autoStart,boolean,required,}
whether or not to auto-start the replication applier on
(next and following) server starts
@RESTBODYPARAM{adaptivePolling,boolean,required,}
if set to *true*, the replication applier will fall
to sleep for an increasingly long period in case the logger server at the
endpoint does not have any more replication events to apply. Using
adaptive polling is thus useful to reduce the amount of work for both the
applier and the logger server for cases when there are only infrequent
changes. The downside is that when using adaptive polling, it might take
longer for the replication applier to detect that there are new replication
events on the logger server.
Setting *adaptivePolling* to false will make the replication applier
contact the logger server in a constant interval, regardless of whether
the logger server provides updates frequently or seldom.
@RESTBODYPARAM{includeSystem,boolean,required,}
whether or not system collection operations will be applied
@RESTBODYPARAM{autoResync,boolean,optional,}
whether or not the slave should perform a full automatic resynchronization
with the master in case the master cannot serve log data requested by the
slave,
or when the replication is started and no tick value can be found.
@RESTBODYPARAM{autoResyncRetries,integer,optional,int64}
number of resynchronization retries that will be performed in a row when
automatic resynchronization is enabled and kicks in. Setting this to *0*
will
effectively disable *autoResync*. Setting it to some other value will limit
the number of retries that are performed. This helps preventing endless
retries
in case resynchronizations always fail.
@RESTBODYPARAM{initialSyncMaxWaitTime,integer,optional,int64}
the maximum wait time (in seconds) that the initial synchronization will
wait for a response from the master when fetching initial collection data.
This wait time can be used to control after what time the initial
synchronization
will give up waiting for a response and fail. This value is relevant even
for continuous replication when *autoResync* is set to *true* because this
may re-start the initial synchronization when the master cannot provide
log data the slave requires.
This value will be ignored if set to *0*.
@RESTBODYPARAM{connectionRetryWaitTime,integer,optional,int64}
the time (in seconds) that the applier will intentionally idle before
it retries connecting to the master in case of connection problems.
This value will be ignored if set to *0*.
@RESTBODYPARAM{idleMinWaitTime,integer,optional,int64}
the minimum wait time (in seconds) that the applier will intentionally idle
before fetching more log data from the master in case the master has
already sent all its log data. This wait time can be used to control the
frequency with which the replication applier sends HTTP log fetch requests
to the master in case there is no write activity on the master.
This value will be ignored if set to *0*.
@RESTBODYPARAM{idleMaxWaitTime,integer,optional,int64}
the maximum wait time (in seconds) that the applier will intentionally idle
before fetching more log data from the master in case the master has
already sent all its log data and there have been previous log fetch attempts
that resulted in no more log data. This wait time can be used to control the
maximum frequency with which the replication applier sends HTTP log fetch
requests to the master in case there is no write activity on the master for
longer periods. This configuration value will only be used if the option
*adaptivePolling* is set to *true*.
This value will be ignored if set to *0*.
@RESTBODYPARAM{requireFromPresent,boolean,required,}
if set to *true*, then the replication applier will check
at start whether the start tick from which it starts or resumes replication is
still present on the master. If not, then there would be data loss. If
*requireFromPresent* is *true*, the replication applier will abort with an
appropriate error message. If set to *false*, then the replication applier will
still start, and ignore the data loss.
@RESTBODYPARAM{verbose,boolean,required,}
if set to *true*, then a log line will be emitted for all operations
performed by the replication applier. This should be used for debugging replication
problems only.
@RESTBODYPARAM{restrictType,string,required,string}
the configuration for *restrictCollections*; Has to be either *include* or *exclude*
@RESTBODYPARAM{restrictCollections,array,optional,string}
the array of collections to include or exclude,
based on the setting of *restrictType*
@RESTDESCRIPTION
Sets the configuration of the replication applier. The configuration can
only be changed while the applier is not running. The updated configuration
will be saved immediately but only become active with the next start of the
applier.
In case of success, the body of the response is a JSON object with the updated
configuration.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{400}
is returned if the configuration is incomplete or malformed, or if the
replication applier is currently running.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
<div class="example-container" id="RestReplicationApplierSetConfig_container">
<a class="anchorjs-link " href="#RestReplicationApplierSetConfig_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationApplierSetConfig_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/replication/applier-config</span> &lt;&lt;EOF
{
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"username"</span> : <span class="hljs-string">"replicationApplier"</span>,
<span class="hljs-string">"password"</span> : <span class="hljs-string">"applier1234@foxx"</span>,
<span class="hljs-string">"chunkSize"</span> : <span class="hljs-number">4194304</span>,
<span class="hljs-string">"autoStart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"adaptivePolling"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"username"</span> : <span class="hljs-string">"replicationApplier"</span>,
<span class="hljs-string">"requestTimeout"</span> : <span class="hljs-number">600</span>,
<span class="hljs-string">"connectTimeout"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"ignoreErrors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"maxConnectRetries"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"lockTimeoutRetries"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"sslProtocol"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"chunkSize"</span> : <span class="hljs-number">4194304</span>,
<span class="hljs-string">"skipCreateDrop"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"autoStart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"adaptivePolling"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"autoResync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"autoResyncRetries"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"maxPacketSize"</span> : <span class="hljs-number">536870912</span>,
<span class="hljs-string">"includeSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"includeFoxxQueues"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"requireFromPresent"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"verbose"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"incremental"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"restrictType"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"restrictCollections"</span> : [ ],
<span class="hljs-string">"connectionRetryWaitTime"</span> : <span class="hljs-number">15</span>,
<span class="hljs-string">"initialSyncMaxWaitTime"</span> : <span class="hljs-number">300</span>,
<span class="hljs-string">"idleMinWaitTime"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"idleMaxWaitTime"</span> : <span class="hljs-number">2.5</span>
}
</pre>
<div id="RestReplicationApplierSetConfig_container_collapse" onclick="$('#RestReplicationApplierSetConfig_long').hide(); $('#RestReplicationApplierSetConfig_short').show(); window.location.hash='RestReplicationApplierSetConfig_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationApplierSetConfig_short" onclick="$('#RestReplicationApplierSetConfig_short').hide(); $('#RestReplicationApplierSetConfig_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/replication/applier-config</span> &lt;&lt;EOF
{
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"username"</span> : <span class="hljs-string">"replicationApplier"</span>,
<span class="hljs-string">"password"</span> : <span class="hljs-string">"applier1234@foxx"</span>,
<span class="hljs-string">"chunkSize"</span> : <span class="hljs-number">4194304</span>,
<span class="hljs-string">"autoStart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"adaptivePolling"</span> : <span class="hljs-literal">true</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/delete_batch_replication.md -->
@startDocuBlock delete_batch_replication
@brief handle a dump batch command
@RESTHEADER{DELETE /_api/replication/batch/{id}, Deletes an existing dump batch,handleCommandBatch:DELETE}
**Note**: These calls are uninteresting to users.
@RESTURLPARAMETERS
@RESTURLPARAM{id,string,required}
The id of the batch.
@RESTDESCRIPTION
Deletes the existing dump batch, allowing compaction and cleanup to resume.
**Note**: on a coordinator, this request must have the query parameter
*DBserver* which must be an ID of a DBserver.
The very same request is forwarded synchronously to that DBserver.
It is an error if this attribute is not bound in the coordinator case.
@RESTRETURNCODES
@RESTRETURNCODE{204}
is returned if the batch was deleted successfully.
@RESTRETURNCODE{400}
is returned if the batch was not found.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_logger_follow.md -->
@startDocuBlock get_api_replication_logger_follow
@brief Fetch log lines from the server
@RESTHEADER{GET /_api/replication/logger-follow, Returns log entries, handleCommandLoggerFollow}
@HINTS
{% hint 'warning' %}
This route should no longer be used.
It is considered as deprecated from version 3.4.0 on.
{% endhint %}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{from,number,optional}
Exclusive lower bound tick value for results.
@RESTQUERYPARAM{to,number,optional}
Inclusive upper bound tick value for results.
@RESTQUERYPARAM{chunkSize,number,optional}
Approximate maximum size of the returned result.
@RESTQUERYPARAM{includeSystem,boolean,optional}
Include system collections in the result. The default value is *true*.
@RESTDESCRIPTION
Returns data from the server's replication log. This method can be called
by replication clients after an initial synchronization of data. The method
will return all "recent" log entries from the logger server, and the clients
can replay and apply these entries locally so they get to the same data
state as the logger server.
Clients can call this method repeatedly to incrementally fetch all changes
from the logger server. In this case, they should provide the *from* value so
they will only get returned the log events since their last fetch.
When the *from* query parameter is not used, the logger server will return log
entries starting at the beginning of its replication log. When the *from*
parameter is used, the logger server will only return log entries which have
higher tick values than the specified *from* value (note: the log entry with a
tick value equal to *from* will be excluded). Use the *from* value when
incrementally fetching log data.
The *to* query parameter can be used to optionally restrict the upper bound of
the result to a certain tick value. If used, the result will contain only log events
with tick values up to (including) *to*. In incremental fetching, there is no
need to use the *to* parameter. It only makes sense in special situations,
when only parts of the change log are required.
The *chunkSize* query parameter can be used to control the size of the result.
It must be specified in bytes. The *chunkSize* value will only be honored
approximately. Otherwise a too low *chunkSize* value could cause the server
to not be able to put just one log entry into the result and return it.
Therefore, the *chunkSize* value will only be consulted after a log entry has
been written into the result. If the result size is then bigger than
*chunkSize*, the server will respond with as many log entries as there are
in the response already. If the result size is still smaller than *chunkSize*,
the server will try to return more data if there's more data left to return.
If *chunkSize* is not specified, some server-side default value will be used.
The *Content-Type* of the result is *application/x-arango-dump*. This is an
easy-to-process format, with all log events going onto separate lines in the
response body. Each log event itself is a JSON object, with at least the
following attributes:
- *tick*: the log event tick value
- *type*: the log event type
Individual log events will also have additional attributes, depending on the
event type. A few common attributes which are used for multiple events types
are:
- *cid*: id of the collection the event was for
- *tid*: id of the transaction the event was contained in
- *key*: document key
- *rev*: document revision id
- *data*: the original document data
A more detailed description of the individual replication event types and their
data structures can be found in [Operation Types](../Replications/WALAccess.html#operation-types).
The response will also contain the following HTTP headers:
- *x-arango-replication-active*: whether or not the logger is active. Clients
can use this flag as an indication for their polling frequency. If the
logger is not active and there are no more replication events available, it
might be sensible for a client to abort, or to go to sleep for a long time
and try again later to check whether the logger has been activated.
- *x-arango-replication-lastincluded*: the tick value of the last included
value in the result. In incremental log fetching, this value can be used
as the *from* value for the following request. **Note** that if the result is
empty, the value will be *0*. This value should not be used as *from* value
by clients in the next request (otherwise the server would return the log
events from the start of the log again).
- *x-arango-replication-lasttick*: the last tick value the logger server has
logged (not necessarily included in the result). By comparing the the last
tick and last included tick values, clients have an approximate indication of
how many events there are still left to fetch.
- *x-arango-replication-checkmore*: whether or not there already exists more
log data which the client could fetch immediately. If there is more log data
available, the client could call *logger-follow* again with an adjusted *from*
value to fetch remaining log entries until there are no more.
If there isn't any more log data to fetch, the client might decide to go
to sleep for a while before calling the logger again.
**Note**: this method is not supported on a coordinator in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully, and there are log
events available for the requested range. The response body will not be empty
in this case.
@RESTRETURNCODE{204}
is returned if the request was executed successfully, but there are no log
events available for the requested range. The response body will be empty
in this case.
@RESTRETURNCODE{400}
is returned if either the *from* or *to* values are invalid.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@EXAMPLES
No log events available
<div class="example-container" id="RestReplicationLoggerFollowEmpty_container">
<a class="anchorjs-link " href="#RestReplicationLoggerFollowEmpty_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationLoggerFollowEmpty_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-follow?from=188604</span>
HTTP/1.1 No Content
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-active: true
x-arango-replication-checkmore: false
x-arango-replication-frompresent: true
x-arango-replication-lastincluded: 0
x-arango-replication-lastscanned: 188604
x-arango-replication-lasttick: 188604
x-content-type-options: nosniff
</pre>
</div>
</div>
A few log events *(One JSON document per line)*
<div class="example-container" id="RestReplicationLoggerFollowSome_container">
<a class="anchorjs-link " href="#RestReplicationLoggerFollowSome_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationLoggerFollowSome_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-follow?from=188604</span>
HTTP/1.1 OK
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-active: true
x-arango-replication-checkmore: false
x-arango-replication-frompresent: true
x-arango-replication-lastincluded: 188629
x-arango-replication-lastscanned: 188626
x-arango-replication-lasttick: 188629
x-content-type-options: nosniff
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"188607"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2300</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"1"</span>,
<span class="hljs-string">"tid"</span> : <span class="hljs-string">"0"</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"4"</span>,
<span class="hljs-string">"cname"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"92"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_users/92"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Y2W--_"</span>,
<span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"source"</span> : <span class="hljs-string">"LOCAL"</span>,
<span class="hljs-string">"authData"</span> : {
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"simple"</span> : {
<span class="hljs-string">"hash"</span> : <span class="hljs-string">"d514ee5c79854635a9f7d645c73d4626f94114486a23d3b166cc389db869972a"</span>,
<span class="hljs-string">"salt"</span> : <span class="hljs-string">"992cb173"</span>,
<span class="hljs-string">"method"</span> : <span class="hljs-string">"sha256"</span>
}
},
<span class="hljs-string">"databases"</span> : {
<span class="hljs-string">"_system"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"demo"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"animals"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"products"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"products1"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
}
}
},
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
}
}
}
}
}
}&#x21A9;
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"188620"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2001</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"1"</span>,
<span class="hljs-string">"cuid"</span> : <span class="hljs-string">"h34D5FCD00B2F/70523"</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"70523"</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"id"</span> : <span class="hljs-string">"70523"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">""</span>
}
}&#x21A9;
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"188627"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2300</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"1"</span>,
<span class="hljs-string">"tid"</span> : <span class="hljs-string">"0"</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"4"</span>,
<span class="hljs-string">"cname"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"92"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_users/92"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6Y2a--E"</span>,
<span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"source"</span> : <span class="hljs-string">"LOCAL"</span>,
<span class="hljs-string">"authData"</span> : {
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"simple"</span> : {
<span class="hljs-string">"hash"</span> : <span class="hljs-string">"d514ee5c79854635a9f7d645c73d4626f94114486a23d3b166cc389db869972a"</span>,
<span class="hljs-string">"salt"</span> : <span class="hljs-string">"992cb173"</span>,
<span class="hljs-string">"method"</span> : <span class="hljs-string">"sha256"</span>
}
},
<span class="hljs-string">"databases"</span> : {
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
}
}
},
<span class="hljs-string">"_system"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"products1"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"demo"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"animals"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
}
}
}
}
}
}&#x21A9;
</pre>
<div id="RestReplicationLoggerFollowSome_container_collapse" onclick="$('#RestReplicationLoggerFollowSome_long').hide(); $('#RestReplicationLoggerFollowSome_short').show(); window.location.hash='RestReplicationLoggerFollowSome_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationLoggerFollowSome_short" onclick="$('#RestReplicationLoggerFollowSome_short').hide(); $('#RestReplicationLoggerFollowSome_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-follow?from=188604</span>
HTTP/1.1 OK
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-active: true
x-arango-replication-checkmore: false
x-arango-replication-frompresent: true
x-arango-replication-lastincluded: 188629
x-arango-replication-lastscanned: 188626
x-arango-replication-lasttick: 188629
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
More events than would fit into the response
<div class="example-container" id="RestReplicationLoggerFollowBufferLimit_container">
<a class="anchorjs-link " href="#RestReplicationLoggerFollowBufferLimit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationLoggerFollowBufferLimit_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-follow?from=188576&amp;chunkSize=400</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/x-arango-dump; charset=utf<span class="hljs-number">-8</span>
x-arango-replication-active: <span class="hljs-literal">true</span>
x-arango-replication-checkmore: <span class="hljs-literal">true</span>
x-arango-replication-frompresent: <span class="hljs-literal">true</span>
x-arango-replication-lastincluded: <span class="hljs-number">188581</span>
x-arango-replication-lastscanned: <span class="hljs-number">188578</span>
x-arango-replication-lasttick: <span class="hljs-number">188604</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"188579"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2300</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"1"</span>,
<span class="hljs-string">"tid"</span> : <span class="hljs-string">"0"</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"4"</span>,
<span class="hljs-string">"cname"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"92"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_users/92"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF6X16--_"</span>,
<span class="hljs-string">"user"</span> : <span class="hljs-string">"root"</span>,
<span class="hljs-string">"source"</span> : <span class="hljs-string">"LOCAL"</span>,
<span class="hljs-string">"authData"</span> : {
<span class="hljs-string">"active"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"simple"</span> : {
<span class="hljs-string">"hash"</span> : <span class="hljs-string">"d514ee5c79854635a9f7d645c73d4626f94114486a23d3b166cc389db869972a"</span>,
<span class="hljs-string">"salt"</span> : <span class="hljs-string">"992cb173"</span>,
<span class="hljs-string">"method"</span> : <span class="hljs-string">"sha256"</span>
}
},
<span class="hljs-string">"databases"</span> : {
<span class="hljs-string">"_system"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"animals"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"demo"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"products"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
},
<span class="hljs-string">"products1"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
}
}
},
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
},
<span class="hljs-string">"collections"</span> : {
<span class="hljs-string">"*"</span> : {
<span class="hljs-string">"permissions"</span> : {
<span class="hljs-string">"read"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"write"</span> : <span class="hljs-literal">true</span>
}
}
}
}
}
}
}
</pre>
<div id="RestReplicationLoggerFollowBufferLimit_container_collapse" onclick="$('#RestReplicationLoggerFollowBufferLimit_long').hide(); $('#RestReplicationLoggerFollowBufferLimit_short').show(); window.location.hash='RestReplicationLoggerFollowBufferLimit_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationLoggerFollowBufferLimit_short" onclick="$('#RestReplicationLoggerFollowBufferLimit_short').hide(); $('#RestReplicationLoggerFollowBufferLimit_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-follow?from=188576&amp;chunkSize=400</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/x-arango-dump; charset=utf<span class="hljs-number">-8</span>
x-arango-replication-active: <span class="hljs-literal">true</span>
x-arango-replication-checkmore: <span class="hljs-literal">true</span>
x-arango-replication-frompresent: <span class="hljs-literal">true</span>
x-arango-replication-lastincluded: <span class="hljs-number">188581</span>
x-arango-replication-lastscanned: <span class="hljs-number">188578</span>
x-arango-replication-lasttick: <span class="hljs-number">188604</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_applier_stop.md -->
@startDocuBlock put_api_replication_applier_stop
@brief stop the replication
@RESTHEADER{PUT /_api/replication/applier-stop, Stop replication applier,handleCommandApplierStop}
@RESTDESCRIPTION
Stops the replication applier. This will return immediately if the
replication applier is not running.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
<div class="example-container" id="RestReplicationApplierStop_container">
<a class="anchorjs-link " href="#RestReplicationApplierStop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationApplierStop_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-stop</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"started"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>,
<span class="hljs-string">"running"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"phase"</span> : <span class="hljs-string">"inactive"</span>,
<span class="hljs-string">"lastAppliedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastProcessedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastAvailableContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"safeResumeTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"progress"</span> : {
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:20Z"</span>,
<span class="hljs-string">"message"</span> : <span class="hljs-string">"applier shut down"</span>,
<span class="hljs-string">"failedConnects"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"totalRequests"</span> : <span class="hljs-number">6</span>,
<span class="hljs-string">"totalFailedConnects"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalDocuments"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalRemovals"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalResyncs"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalOperationsExcluded"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"lastError"</span> : {
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:20Z"</span>
},
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
},
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
</pre>
<div id="RestReplicationApplierStop_container_collapse" onclick="$('#RestReplicationApplierStop_long').hide(); $('#RestReplicationApplierStop_short').show(); window.location.hash='RestReplicationApplierStop_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationApplierStop_short" onclick="$('#RestReplicationApplierStop_short').hide(); $('#RestReplicationApplierStop_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-stop</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_synchronize.md -->
@startDocuBlock put_api_replication_synchronize
@brief start a replication
@RESTHEADER{PUT /_api/replication/sync, Synchronize data from a remote endpoint, handleCommandSync}
@RESTBODYPARAM{endpoint,string,required,string}
the master endpoint to connect to (e.g. "tcp://192.168.173.13:8529").
@RESTBODYPARAM{database,string,optional,string}
the database name on the master (if not specified, defaults to the
name of the local current database).
@RESTBODYPARAM{username,string,optional,string}
an optional ArangoDB username to use when connecting to the endpoint.
@RESTBODYPARAM{password,string,required,string}
the password to use when connecting to the endpoint.
@RESTBODYPARAM{includeSystem,boolean,optional,}
whether or not system collection operations will be applied
@RESTBODYPARAM{incremental,boolean,optional,}
if set to *true*, then an incremental synchronization method will be used
for synchronizing data in collections. This method is useful when
collections already exist locally, and only the remaining differences need
to be transferred from the remote endpoint. In this case, the incremental
synchronization can be faster than a full synchronization.
The default value is *false*, meaning that the complete data from the remote
collection will be transferred.
@RESTBODYPARAM{restrictType,string,optional,string}
an optional string value for collection filtering. When
specified, the allowed values are *include* or *exclude*.
@RESTBODYPARAM{restrictCollections,array,optional,string}
an optional array of collections for use with
*restrictType*. If *restrictType* is *include*, only the specified collections
will be sychronised. If *restrictType* is *exclude*, all but the specified
collections will be synchronized.
@RESTBODYPARAM{initialSyncMaxWaitTime,integer,optional,int64}
the maximum wait time (in seconds) that the initial synchronization will
wait for a response from the master when fetching initial collection data.
This wait time can be used to control after what time the initial synchronization
will give up waiting for a response and fail.
This value will be ignored if set to *0*.
@RESTDESCRIPTION
Starts a full data synchronization from a remote endpoint into the local
ArangoDB database.
The *sync* method can be used by replication clients to connect an ArangoDB database
to a remote endpoint, fetch the remote list of collections and indexes, and collection
data. It will thus create a local backup of the state of data at the remote ArangoDB
database. *sync* works on a per-database level.
*sync* will first fetch the list of collections and indexes from the remote endpoint.
It does so by calling the *inventory* API of the remote database. It will then purge
data in the local ArangoDB database, and after start will transfer collection data
from the remote database to the local ArangoDB database. It will extract data from the
remote database by calling the remote database's *dump* API until all data are fetched.
In case of success, the body of the response is a JSON object with the following
attributes:
- *collections*: an array of collections that were transferred from the endpoint
- *lastLogTick*: the last log tick on the endpoint at the time the transfer
was started. Use this value as the *from* value when starting the continuous
synchronization later.
WARNING: calling this method will sychronize data from the collections found
on the remote endpoint to the local ArangoDB database. All data in the local
collections will be purged and replaced with data from the endpoint.
Use with caution!
**Note**: this method is not supported on a coordinator in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{400}
is returned if the configuration is incomplete or malformed.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred during sychronization.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_wal_access_last_tick.md -->
@startDocuBlock get_api_wal_access_last_tick
@brief Return last available tick value
@RESTHEADER{GET /_api/wal/lastTick, Return last available tick value, handleCommandLastTick}
@RESTDESCRIPTION
Returns the last available tick value that can be served from the server's
replication log. This corresponds to the tick of the latest successfull operation.
The result is a JSON object containing the attributes *tick*, *time* and *server*.
* *tick*: contains the last available tick, *time*
* *time*: the server time as string in format "YYYY-MM-DDTHH:MM:SSZ"
* *server*: An object with fields *version* and *serverId*
**Note**: this method is not supported on a coordinator in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@EXAMPLES
Returning the first available tick
<div class="example-container" id="RestWalAccessFirstTick_container">
<a class="anchorjs-link " href="#RestWalAccessFirstTick_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalAccessFirstTick_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/lastTick</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:23Z"</span>,
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"191436"</span>,
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
}
}
</pre>
<div id="RestWalAccessFirstTick_container_collapse" onclick="$('#RestWalAccessFirstTick_long').hide(); $('#RestWalAccessFirstTick_short').show(); window.location.hash='RestWalAccessFirstTick_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalAccessFirstTick_short" onclick="$('#RestWalAccessFirstTick_short').hide(); $('#RestWalAccessFirstTick_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/lastTick</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_wal_access_range.md -->
@startDocuBlock get_api_wal_access_range
@brief returns the tick ranges available in the write-ahead-log
@RESTHEADER{GET /_api/wal/range, Return tick ranges available in the operations of WAL, handleCommandTickRange}
@RESTDESCRIPTION
Returns the currently available ranges of tick values for all WAL files.
The tick values can be used to determine if certain
data (identified by tick value) are still available for replication.
The body of the response contains a JSON object.
* *tickMin*: minimum tick available
* *tickMax*: maximum tick available
* *time*: the server time as string in format "YYYY-MM-DDTHH:MM:SSZ"
* *server*: An object with fields *version* and *serverId*
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the tick ranges could be determined successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if the server operations state could not be determined.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@EXAMPLES
Returns the available tick ranges.
<div class="example-container" id="RestWalAccessTickRange_container">
<a class="anchorjs-link " href="#RestWalAccessTickRange_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalAccessTickRange_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/range</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:25Z"</span>,
<span class="hljs-string">"tickMin"</span> : <span class="hljs-string">"185805"</span>,
<span class="hljs-string">"tickMax"</span> : <span class="hljs-string">"191486"</span>,
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
}
}
</pre>
<div id="RestWalAccessTickRange_container_collapse" onclick="$('#RestWalAccessTickRange_long').hide(); $('#RestWalAccessTickRange_short').show(); window.location.hash='RestWalAccessTickRange_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalAccessTickRange_short" onclick="$('#RestWalAccessTickRange_short').hide(); $('#RestWalAccessTickRange_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/range</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_applier_start.md -->
@startDocuBlock put_api_replication_applier_start
@brief start the replication applier
@RESTHEADER{PUT /_api/replication/applier-start, Start replication applier,handleCommandApplierStart}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{from,string,optional}
The remote *lastLogTick* value from which to start applying. If not specified,
the last saved tick from the previous applier run is used. If there is no
previous applier state saved, the applier will start at the beginning of the
logger server's log.
@RESTDESCRIPTION
Starts the replication applier. This will return immediately if the
replication applier is already running.
If the replication applier is not already running, the applier configuration
will be checked, and if it is complete, the applier will be started in a
background thread. This means that even if the applier will encounter any
errors while running, they will not be reported in the response to this
method.
To detect replication applier errors after the applier was started, use the
*/_api/replication/applier-state* API instead.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{400}
is returned if the replication applier is not fully configured or the
configuration is invalid.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
<div class="example-container" id="RestReplicationApplierStart_container">
<a class="anchorjs-link " href="#RestReplicationApplierStart_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationApplierStart_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-start</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"started"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"running"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"phase"</span> : <span class="hljs-string">"running"</span>,
<span class="hljs-string">"lastAppliedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastProcessedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastAvailableContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"safeResumeTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"ticksBehind"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"progress"</span> : {
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:16Z"</span>,
<span class="hljs-string">"message"</span> : <span class="hljs-string">"applier initially created for database '_system'"</span>,
<span class="hljs-string">"failedConnects"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"totalRequests"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalFailedConnects"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalDocuments"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalRemovals"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalResyncs"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalOperationsExcluded"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"lastError"</span> : {
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>
},
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
},
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
</pre>
<div id="RestReplicationApplierStart_container_collapse" onclick="$('#RestReplicationApplierStart_long').hide(); $('#RestReplicationApplierStart_short').show(); window.location.hash='RestReplicationApplierStart_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationApplierStart_short" onclick="$('#RestReplicationApplierStart_short').hide(); $('#RestReplicationApplierStart_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-start</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/post_batch_replication.md -->
@startDocuBlock post_batch_replication
@brief handle a dump batch command
@RESTHEADER{POST /_api/replication/batch, Create new dump batch, handleCommandBatch:Create}
**Note**: These calls are uninteresting to users.
@RESTBODYPARAM{ttl,integer,required,int64}
the time-to-live for the new batch (in seconds)
A JSON object with the batch configuration.
@RESTDESCRIPTION
Creates a new dump batch and returns the batch's id.
The response is a JSON object with the following attributes:
- *id*: the id of the batch
**Note**: on a coordinator, this request must have the query parameter
*DBserver* which must be an ID of a DBserver.
The very same request is forwarded synchronously to that DBserver.
It is an error if this attribute is not bound in the coordinator case.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the batch was created successfully.
@RESTRETURNCODE{400}
is returned if the ttl value is invalid or if *DBserver* attribute
is not specified or illegal on a coordinator.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_applier.md -->
@startDocuBlock put_api_replication_applier
@brief fetch the current replication configuration
@RESTHEADER{GET /_api/replication/applier-config, Return configuration of replication applier, handleCommandApplierGetConfig}
@RESTDESCRIPTION
Returns the configuration of the replication applier.
The body of the response is a JSON object with the configuration. The
following attributes may be present in the configuration:
- *endpoint*: the logger server to connect to (e.g. "tcp://192.168.173.13:8529").
- *database*: the name of the database to connect to (e.g. "_system").
- *username*: an optional ArangoDB username to use when connecting to the endpoint.
- *password*: the password to use when connecting to the endpoint.
- *maxConnectRetries*: the maximum number of connection attempts the applier
will make in a row. If the applier cannot establish a connection to the
endpoint in this number of attempts, it will stop itself.
- *connectTimeout*: the timeout (in seconds) when attempting to connect to the
endpoint. This value is used for each connection attempt.
- *requestTimeout*: the timeout (in seconds) for individual requests to the endpoint.
- *chunkSize*: the requested maximum size for log transfer packets that
is used when the endpoint is contacted.
- *autoStart*: whether or not to auto-start the replication applier on
(next and following) server starts
- *adaptivePolling*: whether or not the replication applier will use
adaptive polling.
- *includeSystem*: whether or not system collection operations will be applied
- *autoResync*: whether or not the slave should perform a full automatic
resynchronization with the master in case the master cannot serve log data
requested by the slave, or when the replication is started and no tick
value
can be found.
- *autoResyncRetries*: number of resynchronization retries that will be performed
in a row when automatic resynchronization is enabled and kicks in. Setting this
to *0* will effectively disable *autoResync*. Setting it to some other value
will limit the number of retries that are performed. This helps preventing endless
retries in case resynchronizations always fail.
- *initialSyncMaxWaitTime*: the maximum wait time (in seconds) that the initial
synchronization will wait for a response from the master when fetching initial
collection data.
This wait time can be used to control after what time the initial synchronization
will give up waiting for a response and fail. This value is relevant even
for continuous replication when *autoResync* is set to *true* because this
may re-start the initial synchronization when the master cannot provide
log data the slave requires.
This value will be ignored if set to *0*.
- *connectionRetryWaitTime*: the time (in seconds) that the applier will
intentionally idle before it retries connecting to the master in case of
connection problems.
This value will be ignored if set to *0*.
- *idleMinWaitTime*: the minimum wait time (in seconds) that the applier will
intentionally idle before fetching more log data from the master in case
the master has already sent all its log data. This wait time can be used
to control the frequency with which the replication applier sends HTTP log
fetch requests to the master in case there is no write activity on the master.
This value will be ignored if set to *0*.
- *idleMaxWaitTime*: the maximum wait time (in seconds) that the applier will
intentionally idle before fetching more log data from the master in case the
master has already sent all its log data and there have been previous log
fetch attempts that resulted in no more log data. This wait time can be used
to control the maximum frequency with which the replication applier sends HTTP
log fetch requests to the master in case there is no write activity on the
master for longer periods. This configuration value will only be used if the
option *adaptivePolling* is set to *true*.
This value will be ignored if set to *0*.
- *requireFromPresent*: if set to *true*, then the replication applier will check
at start whether the start tick from which it starts or resumes replication is
still present on the master. If not, then there would be data loss. If
*requireFromPresent* is *true*, the replication applier will abort with an
appropriate error message. If set to *false*, then the replication applier will
still start, and ignore the data loss.
- *verbose*: if set to *true*, then a log line will be emitted for all operations
performed by the replication applier. This should be used for debugging
replication
problems only.
- *restrictType*: the configuration for *restrictCollections*
- *restrictCollections*: the optional array of collections to include or exclude,
based on the setting of *restrictType*
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
<div class="example-container" id="RestReplicationApplierGetConfig_container">
<a class="anchorjs-link " href="#RestReplicationApplierGetConfig_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationApplierGetConfig_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-config</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"requestTimeout"</span> : <span class="hljs-number">600</span>,
<span class="hljs-string">"connectTimeout"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"ignoreErrors"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"maxConnectRetries"</span> : <span class="hljs-number">100</span>,
<span class="hljs-string">"lockTimeoutRetries"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"sslProtocol"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"chunkSize"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"skipCreateDrop"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"autoStart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"adaptivePolling"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"autoResync"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"autoResyncRetries"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"maxPacketSize"</span> : <span class="hljs-number">536870912</span>,
<span class="hljs-string">"includeSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"includeFoxxQueues"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"requireFromPresent"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"verbose"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"incremental"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"restrictType"</span> : <span class="hljs-string">""</span>,
<span class="hljs-string">"restrictCollections"</span> : [ ],
<span class="hljs-string">"connectionRetryWaitTime"</span> : <span class="hljs-number">15</span>,
<span class="hljs-string">"initialSyncMaxWaitTime"</span> : <span class="hljs-number">300</span>,
<span class="hljs-string">"idleMinWaitTime"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"idleMaxWaitTime"</span> : <span class="hljs-number">2.5</span>
}
</pre>
<div id="RestReplicationApplierGetConfig_container_collapse" onclick="$('#RestReplicationApplierGetConfig_long').hide(); $('#RestReplicationApplierGetConfig_short').show(); window.location.hash='RestReplicationApplierGetConfig_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationApplierGetConfig_short" onclick="$('#RestReplicationApplierGetConfig_short').hide(); $('#RestReplicationApplierGetConfig_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-config</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_logger_tick_ranges.md -->
@startDocuBlock get_api_replication_logger_tick_ranges
@brief returns the tick value ranges available in the logfiles
@RESTHEADER{GET /_api/replication/logger-tick-ranges, Return the tick ranges available in the WAL logfiles,handleCommandLoggerTickRanges}
@RESTDESCRIPTION
Returns the currently available ranges of tick values for all currently
available WAL logfiles. The tick values can be used to determine if certain
data (identified by tick value) are still available for replication.
The body of the response contains a JSON array. Each array member is an
object
that describes a single logfile. Each object has the following attributes:
* *datafile*: name of the logfile
* *status*: status of the datafile, in textual form (e.g. "sealed", "open")
* *tickMin*: minimum tick value contained in logfile
* *tickMax*: maximum tick value contained in logfile
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the tick ranges could be determined successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if the logger state could not be determined.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@EXAMPLES
Returns the available tick ranges.
<div class="example-container" id="RestReplicationLoggerTickRanges_container">
<a class="anchorjs-link " href="#RestReplicationLoggerTickRanges_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationLoggerTickRanges_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-tick-ranges</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
[
{
<span class="hljs-string">"datafile"</span> : <span class="hljs-string">"/archive/000068.log"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"collected"</span>,
<span class="hljs-string">"tickMin"</span> : <span class="hljs-string">"185805"</span>,
<span class="hljs-string">"tickMax"</span> : <span class="hljs-string">"185864"</span>
},
{
<span class="hljs-string">"datafile"</span> : <span class="hljs-string">"/archive/000086.log"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"collected"</span>,
<span class="hljs-string">"tickMin"</span> : <span class="hljs-string">"185864"</span>,
<span class="hljs-string">"tickMax"</span> : <span class="hljs-string">"185902"</span>
},
{
<span class="hljs-string">"datafile"</span> : <span class="hljs-string">"/000095.log"</span>,
<span class="hljs-string">"status"</span> : <span class="hljs-string">"open"</span>,
<span class="hljs-string">"tickMin"</span> : <span class="hljs-string">"185902"</span>,
<span class="hljs-string">"tickMax"</span> : <span class="hljs-string">"188629"</span>
}
]
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_batch_replication.md -->
@startDocuBlock put_batch_replication
@brief handle a dump batch command
@RESTHEADER{PUT /_api/replication/batch/{id}, Prolong existing dump batch, handleCommandBatch:Prolong}
**Note**: These calls are uninteresting to users.
@RESTBODYPARAM{ttl,integer,required,int64}
the time-to-live for the new batch (in seconds)
@RESTURLPARAMETERS
@RESTURLPARAM{id,string,required}
The id of the batch.
@RESTDESCRIPTION
Extends the ttl of an existing dump batch, using the batch's id and
the provided ttl value.
If the batch's ttl can be extended successfully, the response is empty.
**Note**: on a coordinator, this request must have the query parameter
*DBserver* which must be an ID of a DBserver.
The very same request is forwarded synchronously to that DBserver.
It is an error if this attribute is not bound in the coordinator case.
@RESTRETURNCODES
@RESTRETURNCODE{204}
is returned if the batch's ttl was extended successfully.
@RESTRETURNCODE{400}
is returned if the ttl value is invalid or the batch was not found.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_dump.md -->
@startDocuBlock get_api_replication_dump
@brief returns the whole content of one collection
@RESTHEADER{GET /_api/replication/dump, Return data of a collection,handleCommandDump}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{collection,string,required}
The name or id of the collection to dump.
@RESTQUERYPARAM{chunkSize,number,optional} Approximate maximum size of the returned result.
@RESTQUERYPARAM{batchId,number,required}
rocksdb only - The id of the snapshot to use
@RESTQUERYPARAM{from,number,optional}
mmfiles only - Lower bound tick value for results.
@RESTQUERYPARAM{to,number,optional}
mmfiles only - Upper bound tick value for results.
@RESTQUERYPARAM{includeSystem,boolean,optional}
mmfiles only - Include system collections in the result. The default value is *true*.
@RESTQUERYPARAM{ticks,boolean,optional}
mmfiles only - Whether or not to include tick values in the dump. The default value is *true*.
@RESTQUERYPARAM{flush,boolean,optional}
mmfiles only - Whether or not to flush the WAL before dumping. The default value is *true*.
@RESTDESCRIPTION
Returns the data from the collection for the requested range.
When the *from* query parameter is not used, collection events are returned from
the beginning. When the *from* parameter is used, the result will only contain
collection entries which have higher tick values than the specified *from* value
(note: the log entry with a tick value equal to *from* will be excluded).
The *to* query parameter can be used to optionally restrict the upper bound of
the result to a certain tick value. If used, the result will only contain
collection entries with tick values up to (including) *to*.
The *chunkSize* query parameter can be used to control the size of the result.
It must be specified in bytes. The *chunkSize* value will only be honored
approximately. Otherwise a too low *chunkSize* value could cause the server
to not be able to put just one entry into the result and return it.
Therefore, the *chunkSize* value will only be consulted after an entry has
been written into the result. If the result size is then bigger than
*chunkSize*, the server will respond with as many entries as there are
in the response already. If the result size is still smaller than *chunkSize*,
the server will try to return more data if there's more data left to return.
If *chunkSize* is not specified, some server-side default value will be used.
The *Content-Type* of the result is *application/x-arango-dump*. This is an
easy-to-process format, with all entries going onto separate lines in the
response body.
Each line itself is a JSON object, with at least the following attributes:
- *tick*: the operation's tick attribute
- *key*: the key of the document/edge or the key used in the deletion operation
- *rev*: the revision id of the document/edge or the deletion operation
- *data*: the actual document/edge data for types 2300 and 2301. The full
document/edge data will be returned even for updates.
- *type*: the type of entry. Possible values for *type* are:
- 2300: document insertion/update
- 2301: edge insertion/update
- 2302: document/edge deletion
**Note**: there will be no distinction between inserts and updates when calling this method.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully and data was returned. The header
`x-arango-replication-lastincluded` is set to the tick of the last document returned.
@RESTRETURNCODE{204}
is returned if the request was executed successfully, but there was no content available.
The header `x-arango-replication-lastincluded` is `0` in this case.
@RESTRETURNCODE{400}
is returned if either the *from* or *to* values are invalid.
@RESTRETURNCODE{404}
is returned when the collection could not be found.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
Empty collection:
<div class="example-container" id="RestReplicationDumpEmpty_mmfiles_container">
<a class="anchorjs-link " href="#RestReplicationDumpEmpty_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationDumpEmpty_mmfiles_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/dump?collection=testCollection</span>
HTTP/1.1 No Content
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-checkmore: false
x-arango-replication-lastincluded: 0
x-content-type-options: nosniff
</pre>
</div>
</div>
Non-empty collection *(One JSON document per line)*:
<div class="example-container" id="RestReplicationDump_mmfiles_container">
<a class="anchorjs-link " href="#RestReplicationDump_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationDump_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/dump?collection=testCollection</span>
HTTP/1.1 OK
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-checkmore: false
x-arango-replication-lastincluded: 214
x-content-type-options: nosniff
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"208"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2300</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"123456"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"testCollection/123456"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5fo2--_"</span>,
<span class="hljs-string">"b"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"c"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"d"</span> : <span class="hljs-string">"additional value"</span>
}
}&#x21A9;
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"212"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2302</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"foobar"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5fo6--B"</span>
}
}&#x21A9;
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"214"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2302</span>,
<span class="hljs-string">"data"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"abcdef"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5fp---_"</span>
}
}&#x21A9;
</pre>
<div id="RestReplicationDump_mmfiles_container_collapse" onclick="$('#RestReplicationDump_mmfiles_long').hide(); $('#RestReplicationDump_mmfiles_short').show(); window.location.hash='RestReplicationDump_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationDump_mmfiles_short" onclick="$('#RestReplicationDump_mmfiles_short').hide(); $('#RestReplicationDump_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/dump?collection=testCollection</span>
HTTP/1.1 OK
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-checkmore: false
x-arango-replication-lastincluded: 214
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_serverID.md -->
@startDocuBlock put_api_replication_serverID
@brief fetch this server's unique identifier
@RESTHEADER{GET /_api/replication/server-id, Return server id, handleCommandServerId}
@RESTDESCRIPTION
Returns the servers id. The id is also returned by other replication API
methods, and this method is an easy means of determining a server's id.
The body of the response is a JSON object with the attribute *serverId*. The
server id is returned as a string.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
<div class="example-container" id="RestReplicationServerId_container">
<a class="anchorjs-link " href="#RestReplicationServerId_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationServerId_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/server-id</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_wal_access_tail.md -->
@startDocuBlock get_api_wal_access_tail
@brief Fetch recent operations
@RESTHEADER{GET /_api/wal/tail, Tail recent server operations, handleCommandTail}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{from,number,optional}
Exclusive lower bound tick value for results. On successive calls
to this API you should set this to the value returned
with the *x-arango-replication-lastincluded* header (Unless that header
contains 0).
@RESTQUERYPARAM{to,number,optional}
Inclusive upper bound tick value for results.
@RESTQUERYPARAM{lastScanned,number,optional}
Should be set to the value of the *x-arango-replication-lastscanned* header
or alternatively 0 on first try. This allows the rocksdb engine to break up
large transactions over multiple responses.
@RESTQUERYPARAM{global,boolean,optional}
Whether operations for all databases should be included. When set to *false*
only the operations for the current database are included. The value *true* is
only valid on the *_system* database. The default is *false*.
@RESTQUERYPARAM{chunkSize,number,optional}
Approximate maximum size of the returned result.
@RESTQUERYPARAM{syncerId,number,optional}
Id of the client used to tail results. The server will use this to
keep operations until the client has fetched them. Must be a positive integer.
**Note** this or serverId is required to have a chance at fetching reading all
operations with the rocksdb storage engine.
@RESTQUERYPARAM{serverId,number,optional}
Id of the client machine. If *syncerId* is unset, the server will use
this to keep operations until the client has fetched them. Must be a positive
integer.
**Note** this or syncerId is required to have a chance at fetching reading all
operations with the rocksdb storage engine.
@RESTQUERYPARAM{clientInfo,string,optional}
Short description of the client, used for informative purposes only.
@RESTQUERYPARAM{barrierId,number,optional}
Id of barrier used to keep WAL entries around. **Note** this is only required for the
MMFiles storage engine
@RESTDESCRIPTION
Returns data from the server's write-ahead log (also named replication log). This method can be called
by replication clients after an initial synchronization of data. The method
will return all "recent" logged operations from the server. Clients
can replay and apply these operations locally so they get to the same data
state as the server.
Clients can call this method repeatedly to incrementally fetch all changes
from the server. In this case, they should provide the *from* value so
they will only get returned the log events since their last fetch.
When the *from* query parameter is not used, the server will return log
entries starting at the beginning of its replication log. When the *from*
parameter is used, the server will only return log entries which have
higher tick values than the specified *from* value (note: the log entry with a
tick value equal to *from* will be excluded). Use the *from* value when
incrementally fetching log data.
The *to* query parameter can be used to optionally restrict the upper bound of
the result to a certain tick value. If used, the result will contain only log events
with tick values up to (including) *to*. In incremental fetching, there is no
need to use the *to* parameter. It only makes sense in special situations,
when only parts of the change log are required.
The *chunkSize* query parameter can be used to control the size of the result.
It must be specified in bytes. The *chunkSize* value will only be honored
approximately. Otherwise a too low *chunkSize* value could cause the server
to not be able to put just one log entry into the result and return it.
Therefore, the *chunkSize* value will only be consulted after a log entry has
been written into the result. If the result size is then bigger than
*chunkSize*, the server will respond with as many log entries as there are
in the response already. If the result size is still smaller than *chunkSize*,
the server will try to return more data if there's more data left to return.
If *chunkSize* is not specified, some server-side default value will be used.
The *Content-Type* of the result is *application/x-arango-dump*. This is an
easy-to-process format, with all log events going onto separate lines in the
response body. Each log event itself is a JSON object, with at least the
following attributes:
- *tick*: the log event tick value
- *type*: the log event type
Individual log events will also have additional attributes, depending on the
event type. A few common attributes which are used for multiple events types
are:
- *cuid*: globally unique id of the view or collection the event was for
- *db*: the database name the event was for
- *tid*: id of the transaction the event was contained in
- *data*: the original document data
A more detailed description of the individual replication event types and their
data structures can be found in [Operation Types](#operation-types).
The response will also contain the following HTTP headers:
- *x-arango-replication-active*: whether or not the logger is active. Clients
can use this flag as an indication for their polling frequency. If the
logger is not active and there are no more replication events available, it
might be sensible for a client to abort, or to go to sleep for a long time
and try again later to check whether the logger has been activated.
- *x-arango-replication-lastincluded*: the tick value of the last included
value in the result. In incremental log fetching, this value can be used
as the *from* value for the following request. **Note** that if the result is
empty, the value will be *0*. This value should not be used as *from* value
by clients in the next request (otherwise the server would return the log
events from the start of the log again).
- *x-arango-replication-lastscanned*: the last tick the server scanned while
computing the operation log. This might include operations the server did not
returned to you due to various reasons (i.e. the value was filtered or skipped).
You may use this value in the *lastScanned* header to allow the rocksdb engine
to break up requests over multiple responses.
- *x-arango-replication-lasttick*: the last tick value the server has
logged in its write ahead log (not necessarily included in the result). By comparing the the last
tick and last included tick values, clients have an approximate indication of
how many events there are still left to fetch.
- *x-arango-replication-frompresent*: is set to _true_ if server returned
all tick values starting from the specified tick in the _from_ parameter.
Should this be set to false the server did not have these operations anymore
and the client might have missed operations.
- *x-arango-replication-checkmore*: whether or not there already exists more
log data which the client could fetch immediately. If there is more log data
available, the client could call *logger-follow* again with an adjusted *from*
value to fetch remaining log entries until there are no more.
If there isn't any more log data to fetch, the client might decide to go
to sleep for a while before calling the logger again.
**Note**: this method is not supported on a coordinator in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully, and there are log
events available for the requested range. The response body will not be empty
in this case.
@RESTRETURNCODE{204}
is returned if the request was executed successfully, but there are no log
events available for the requested range. The response body will be empty
in this case.
@RESTRETURNCODE{400}
is returned if either the *from* or *to* values are invalid.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@EXAMPLES
No log events available
<div class="example-container" id="RestWalAccessTailingEmpty_container">
<a class="anchorjs-link " href="#RestWalAccessTailingEmpty_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalAccessTailingEmpty_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/tail?from=191461</span>
HTTP/1.1 No Content
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-checkmore: false
x-arango-replication-frompresent: true
x-arango-replication-lastincluded: 0
x-arango-replication-lastscanned: 191458
x-arango-replication-lasttick: 191461
x-content-type-options: nosniff
</pre>
</div>
</div>
A few log events *(One JSON document per line)*
<div class="example-container" id="RestWalAccessTailingSome_container">
<a class="anchorjs-link " href="#RestWalAccessTailingSome_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalAccessTailingSome_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/tail?from=191461</span>
HTTP/1.1 OK
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-checkmore: true
x-arango-replication-frompresent: true
x-arango-replication-lastincluded: 191477
x-arango-replication-lastscanned: 191486
x-arango-replication-lasttick: 191486
x-content-type-options: nosniff
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"191477"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2001</span>,
<span class="hljs-string">"db"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"cuid"</span> : <span class="hljs-string">"h34D5FCD00B2F/72081"</span>
}&#x21A9;
</pre>
<div id="RestWalAccessTailingSome_container_collapse" onclick="$('#RestWalAccessTailingSome_long').hide(); $('#RestWalAccessTailingSome_short').show(); window.location.hash='RestWalAccessTailingSome_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalAccessTailingSome_short" onclick="$('#RestWalAccessTailingSome_short').hide(); $('#RestWalAccessTailingSome_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/tail?from=191461</span>
HTTP/1.1 OK
content-type: application/x-arango-dump; charset=utf-8
x-arango-replication-checkmore: true
x-arango-replication-frompresent: true
x-arango-replication-lastincluded: 191477
x-arango-replication-lastscanned: 191486
x-arango-replication-lasttick: 191486
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
More events than would fit into the response
<div class="example-container" id="RestWalAccessTailingBufferLimit_container">
<a class="anchorjs-link " href="#RestWalAccessTailingBufferLimit_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestWalAccessTailingBufferLimit_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/tail?from=191436&amp;chunkSize=400</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/x-arango-dump; charset=utf<span class="hljs-number">-8</span>
x-arango-replication-checkmore: <span class="hljs-literal">true</span>
x-arango-replication-frompresent: <span class="hljs-literal">true</span>
x-arango-replication-lastincluded: <span class="hljs-number">191452</span>
x-arango-replication-lastscanned: <span class="hljs-number">191461</span>
x-arango-replication-lasttick: <span class="hljs-number">191461</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"191452"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2001</span>,
<span class="hljs-string">"db"</span> : <span class="hljs-string">"_system"</span>,
<span class="hljs-string">"cuid"</span> : <span class="hljs-string">"h34D5FCD00B2F/72069"</span>
}
</pre>
<div id="RestWalAccessTailingBufferLimit_container_collapse" onclick="$('#RestWalAccessTailingBufferLimit_long').hide(); $('#RestWalAccessTailingBufferLimit_short').show(); window.location.hash='RestWalAccessTailingBufferLimit_container';" class="example_show_button">Hide response body</div></div>
<div id="RestWalAccessTailingBufferLimit_short" onclick="$('#RestWalAccessTailingBufferLimit_short').hide(); $('#RestWalAccessTailingBufferLimit_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/wal/tail?from=191436&amp;chunkSize=400</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/x-arango-dump; charset=utf<span class="hljs-number">-8</span>
x-arango-replication-checkmore: <span class="hljs-literal">true</span>
x-arango-replication-frompresent: <span class="hljs-literal">true</span>
x-arango-replication-lastincluded: <span class="hljs-number">191452</span>
x-arango-replication-lastscanned: <span class="hljs-number">191461</span>
x-arango-replication-lasttick: <span class="hljs-number">191461</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_applier_state.md -->
@startDocuBlock get_api_replication_applier_state
@brief output the current status of the replication
@RESTHEADER{GET /_api/replication/applier-state, State of the replication applier,handleCommandApplierGetState}
@RESTDESCRIPTION
Returns the state of the replication applier, regardless of whether the
applier is currently running or not.
The response is a JSON object with the following attributes:
- *state*: a JSON object with the following sub-attributes:
- *running*: whether or not the applier is active and running
- *lastAppliedContinuousTick*: the last tick value from the continuous
replication log the applier has applied.
- *lastProcessedContinuousTick*: the last tick value from the continuous
replication log the applier has processed.
Regularly, the last applied and last processed tick values should be
identical. For transactional operations, the replication applier will first
process incoming log events before applying them, so the processed tick
value might be higher than the applied tick value. This will be the case
until the applier encounters the *transaction commit* log event for the
transaction.
- *lastAvailableContinuousTick*: the last tick value the remote server can
provide, for all databases.
- *ticksBehind*: this attribute will be present only if the applier is currently
running. It will provide the number of log ticks between what the applier
has applied/seen and the last log tick value provided by the remote server.
If this value is zero, then both servers are in sync. If this is non-zero,
then the remote server has additional data that the applier has not yet
fetched and processed, or the remote server may have more data that is not
applicable to the applier.
Client applications can use it to determine approximately how far the applier
is behind the remote server, and can periodically check if the value is
increasing (applier is falling behind) or decreasing (applier is catching up).
Please note that as the remote server will only keep one last log tick value
for all of its databases, but replication may be restricted to just certain
databases on the applier, this value is more meaningful when the global applier
is used.
Additionally, the last log tick provided by the remote server may increase
due to writes into system collections that are not replicated due to replication
configuration. So the reported value may exaggerate the reality a bit for
some scenarios.
- *time*: the time on the applier server.
- *totalRequests*: the total number of requests the applier has made to the
endpoint.
- *totalFailedConnects*: the total number of failed connection attempts the
applier has made.
- *totalEvents*: the total number of log events the applier has processed.
- *totalOperationsExcluded*: the total number of log events excluded because
of *restrictCollections*.
- *progress*: a JSON object with details about the replication applier progress.
It contains the following sub-attributes if there is progress to report:
- *message*: a textual description of the progress
- *time*: the date and time the progress was logged
- *failedConnects*: the current number of failed connection attempts
- *lastError*: a JSON object with details about the last error that happened on
the applier. It contains the following sub-attributes if there was an error:
- *errorNum*: a numerical error code
- *errorMessage*: a textual error description
- *time*: the date and time the error occurred
In case no error has occurred, *lastError* will be empty.
- *server*: a JSON object with the following sub-attributes:
- *version*: the applier server's version
- *serverId*: the applier server's id
- *endpoint*: the endpoint the applier is connected to (if applier is
active) or will connect to (if applier is currently inactive)
- *database*: the name of the database the applier is connected to (if applier is
active) or will connect to (if applier is currently inactive)
Please note that all "tick" values returned do not have a specific unit. Tick
values are only meaningful when compared to each other. Higher tick values mean
"later in time" than lower tick values.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
Fetching the state of an inactive applier:
<div class="example-container" id="RestReplicationApplierStateNotRunning_container">
<a class="anchorjs-link " href="#RestReplicationApplierStateNotRunning_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationApplierStateNotRunning_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-state</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"started"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>,
<span class="hljs-string">"running"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"phase"</span> : <span class="hljs-string">"inactive"</span>,
<span class="hljs-string">"lastAppliedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastProcessedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastAvailableContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"safeResumeTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"progress"</span> : {
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>,
<span class="hljs-string">"message"</span> : <span class="hljs-string">"applier shut down"</span>,
<span class="hljs-string">"failedConnects"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"totalRequests"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"totalFailedConnects"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalDocuments"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalRemovals"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalResyncs"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalOperationsExcluded"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"lastError"</span> : {
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>
},
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
},
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
</pre>
<div id="RestReplicationApplierStateNotRunning_container_collapse" onclick="$('#RestReplicationApplierStateNotRunning_long').hide(); $('#RestReplicationApplierStateNotRunning_short').show(); window.location.hash='RestReplicationApplierStateNotRunning_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationApplierStateNotRunning_short" onclick="$('#RestReplicationApplierStateNotRunning_short').hide(); $('#RestReplicationApplierStateNotRunning_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-state</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
Fetching the state of an active applier:
<div class="example-container" id="RestReplicationApplierStateRunning_container">
<a class="anchorjs-link " href="#RestReplicationApplierStateRunning_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationApplierStateRunning_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-state</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"started"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>,
<span class="hljs-string">"running"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"phase"</span> : <span class="hljs-string">"running"</span>,
<span class="hljs-string">"lastAppliedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastProcessedContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"lastAvailableContinuousTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"safeResumeTick"</span> : <span class="hljs-literal">null</span>,
<span class="hljs-string">"ticksBehind"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"progress"</span> : {
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>,
<span class="hljs-string">"message"</span> : <span class="hljs-string">"fetching master state information"</span>,
<span class="hljs-string">"failedConnects"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"totalRequests"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"totalFailedConnects"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalDocuments"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalRemovals"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalResyncs"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalOperationsExcluded"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageApplyTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"totalFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"averageFetchTime"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"lastError"</span> : {
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:19Z"</span>
},
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>
},
<span class="hljs-string">"endpoint"</span> : <span class="hljs-string">"tcp://127.0.0.1:8529"</span>,
<span class="hljs-string">"database"</span> : <span class="hljs-string">"_system"</span>
}
</pre>
<div id="RestReplicationApplierStateRunning_container_collapse" onclick="$('#RestReplicationApplierStateRunning_long').hide(); $('#RestReplicationApplierStateRunning_short').show(); window.location.hash='RestReplicationApplierStateRunning_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationApplierStateRunning_short" onclick="$('#RestReplicationApplierStateRunning_short').hide(); $('#RestReplicationApplierStateRunning_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/applier-state</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_inventory.md -->
@startDocuBlock put_api_replication_inventory
@brief Returns an overview of collections and their indexes
@RESTHEADER{GET /_api/replication/inventory, Return inventory of collections and indexes, handleCommandInventory}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{includeSystem,boolean,optional}
Include system collections in the result. The default value is *true*.
@RESTQUERYPARAM{global,boolean,optional}
Include alll databases in the response. Only works on `_system` The default value is *false*.
@RESTQUERYPARAM{batchId,number,required}
The RocksDB engine requires a valid batchId for this API call
@RESTDESCRIPTION
Returns the array of collections and indexes available on the server. This
array can be used by replication clients to initiate an initial sync with the
server.
The response will contain a JSON object with the *collection* and *state* and
*tick* attributes.
*collections* is an array of collections with the following sub-attributes:
- *parameters*: the collection properties
- *indexes*: an array of the indexes of a the collection. Primary indexes and edge indexes
are not included in this array.
The *state* attribute contains the current state of the replication logger. It
contains the following sub-attributes:
- *running*: whether or not the replication logger is currently active. Note:
since ArangoDB 2.2, the value will always be *true*
- *lastLogTick*: the value of the last tick the replication logger has written
- *time*: the current time on the server
Replication clients should note the *lastLogTick* value returned. They can then
fetch collections' data using the dump method up to the value of lastLogTick, and
query the continuous replication log for log events after this tick value.
To create a full copy of the collections on the server, a replication client
can execute these steps:
- call the */inventory* API method. This returns the *lastLogTick* value and the
array of collections and indexes from the server.
- for each collection returned by */inventory*, create the collection locally and
call */dump* to stream the collection data to the client, up to the value of
*lastLogTick*.
After that, the client can create the indexes on the collections as they were
reported by */inventory*.
If the clients wants to continuously stream replication log events from the logger
server, the following additional steps need to be carried out:
- the client should call */logger-follow* initially to fetch the first batch of
replication events that were logged after the client's call to */inventory*.
The call to */logger-follow* should use a *from* parameter with the value of the
*lastLogTick* as reported by */inventory*. The call to */logger-follow* will return the
*x-arango-replication-lastincluded* which will contain the last tick value included
in the response.
- the client can then continuously call */logger-follow* to incrementally fetch new
replication events that occurred after the last transfer.
Calls should use a *from* parameter with the value of the *x-arango-replication-lastincluded*
header of the previous response. If there are no more replication events, the
response will be empty and clients can go to sleep for a while and try again
later.
**Note**: on a coordinator, this request must have the query parameter
*DBserver* which must be an ID of a DBserver.
The very same request is forwarded synchronously to that DBserver.
It is an error if this attribute is not bound in the coordinator case.
**Note:**: Using the `global` parameter the top-level object contains a key `databases`
under which each key represents a datbase name, and the value conforms to the above describtion.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@EXAMPLES
<div class="example-container" id="RestReplicationInventory_mmfiles_container">
<a class="anchorjs-link " href="#RestReplicationInventory_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationInventory_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/inventory</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"14"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_analyzers"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"14"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_analyzers"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"14"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"24"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_appbundles"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"24"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_appbundles"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"24"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"49"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382010968571906"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"mount"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_apps"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">72</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_apps"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_aqlfunctions"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_aqlfunctions"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_graphs"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_graphs"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_modules"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_modules"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"33"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382010967523328"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"3"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"3"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">89</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"3"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"113"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/113"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"113"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"animals"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"113"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"104"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/104"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"104"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"demo"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"104"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
}
],
<span class="hljs-string">"views"</span> : [
{
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/119"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"119"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"demoView"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
],
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"running"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"lastLogTick"</span> : <span class="hljs-string">"216"</span>,
<span class="hljs-string">"lastUncommittedLogTick"</span> : <span class="hljs-string">"261"</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">76</span>,
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:17:24Z"</span>
},
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"262"</span>
}
</pre>
<div id="RestReplicationInventory_mmfiles_container_collapse" onclick="$('#RestReplicationInventory_mmfiles_long').hide(); $('#RestReplicationInventory_mmfiles_short').show(); window.location.hash='RestReplicationInventory_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationInventory_mmfiles_short" onclick="$('#RestReplicationInventory_mmfiles_short').hide(); $('#RestReplicationInventory_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/inventory</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
With some additional indexes:
<div class="example-container" id="RestReplicationInventoryIndexes_mmfiles_container">
<a class="anchorjs-link " href="#RestReplicationInventoryIndexes_mmfiles_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationInventoryIndexes_mmfiles_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/inventory</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"collections"</span> : [
{
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"232"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382016812285954"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"name"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"236"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382016813334528"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>,
<span class="hljs-string">"b"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"225"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/225"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"225"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"IndexedCollection1"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"225"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"246"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"fulltext"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382016815431682"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"text"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"minLength"</span> : <span class="hljs-number">10</span>
},
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"250"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"skiplist"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382016816480256"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"a"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"239"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/239"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"239"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"IndexedCollection2"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"239"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"14"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_analyzers"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"14"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_analyzers"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"14"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"24"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_appbundles"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"24"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_appbundles"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"24"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"49"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382010968571906"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"mount"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_apps"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">72</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_apps"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"22"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_aqlfunctions"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_aqlfunctions"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"16"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_graphs"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_graphs"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"6"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_modules"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_modules"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"28"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [
{
<span class="hljs-string">"id"</span> : <span class="hljs-string">"33"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"hash"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"idx_1646382010967523328"</span>,
<span class="hljs-string">"fields"</span> : [
<span class="hljs-string">"user"</span>
],
<span class="hljs-string">"unique"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"sparse"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"deduplicate"</span> : <span class="hljs-literal">true</span>
}
],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"3"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"3"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">1048576</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">89</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"_users"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"3"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"113"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/113"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"113"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"animals"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"113"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-string">"indexes"</span> : [ ],
<span class="hljs-string">"parameters"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"cid"</span> : <span class="hljs-string">"104"</span>,
<span class="hljs-string">"count"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"deleted"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"doCompact"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/104"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"104"</span>,
<span class="hljs-string">"indexBuckets"</span> : <span class="hljs-number">8</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isSystem"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"isVolatile"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"journalSize"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"keyOptions"</span> : {
<span class="hljs-string">"allowUserKeys"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"traditional"</span>,
<span class="hljs-string">"lastValue"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"demo"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"planId"</span> : <span class="hljs-string">"104"</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"shardKeys"</span> : [
<span class="hljs-string">"_key"</span>
],
<span class="hljs-string">"shards"</span> : {
},
<span class="hljs-string">"status"</span> : <span class="hljs-number">3</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"version"</span> : <span class="hljs-number">7</span>,
<span class="hljs-string">"waitForSync"</span> : <span class="hljs-literal">false</span>
}
}
],
<span class="hljs-string">"views"</span> : [
{
<span class="hljs-string">"globallyUniqueId"</span> : <span class="hljs-string">"hD32780171375/119"</span>,
<span class="hljs-string">"id"</span> : <span class="hljs-string">"119"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"demoView"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"arangosearch"</span>,
<span class="hljs-string">"cleanupIntervalStep"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"commitIntervalMsec"</span> : <span class="hljs-number">1000</span>,
<span class="hljs-string">"consolidationIntervalMsec"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"consolidationPolicy"</span> : {
<span class="hljs-string">"type"</span> : <span class="hljs-string">"tier"</span>,
<span class="hljs-string">"segmentsBytesFloor"</span> : <span class="hljs-number">2097152</span>,
<span class="hljs-string">"segmentsBytesMax"</span> : <span class="hljs-number">5368709120</span>,
<span class="hljs-string">"segmentsMax"</span> : <span class="hljs-number">10</span>,
<span class="hljs-string">"segmentsMin"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minScore"</span> : <span class="hljs-number">0</span>
},
<span class="hljs-string">"primarySort"</span> : [ ],
<span class="hljs-string">"writebufferActive"</span> : <span class="hljs-number">0</span>,
<span class="hljs-string">"writebufferIdle"</span> : <span class="hljs-number">64</span>,
<span class="hljs-string">"writebufferSizeMax"</span> : <span class="hljs-number">33554432</span>,
<span class="hljs-string">"links"</span> : {
}
}
],
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"running"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"lastLogTick"</span> : <span class="hljs-string">"216"</span>,
<span class="hljs-string">"lastUncommittedLogTick"</span> : <span class="hljs-string">"252"</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">72</span>,
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:17:24Z"</span>
},
<span class="hljs-string">"tick"</span> : <span class="hljs-string">"252"</span>
}
</pre>
<div id="RestReplicationInventoryIndexes_mmfiles_container_collapse" onclick="$('#RestReplicationInventoryIndexes_mmfiles_long').hide(); $('#RestReplicationInventoryIndexes_mmfiles_short').show(); window.location.hash='RestReplicationInventoryIndexes_mmfiles_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationInventoryIndexes_mmfiles_short" onclick="$('#RestReplicationInventoryIndexes_mmfiles_short').hide(); $('#RestReplicationInventoryIndexes_mmfiles_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/inventory</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/put_api_replication_makeSlave.md -->
@startDocuBlock put_api_replication_makeSlave
@brief Changes role to slave
@RESTHEADER{PUT /_api/replication/make-slave, Turn the server into a slave of another, handleCommandMakeSlave}
@RESTBODYPARAM{endpoint,string,required,string}
the master endpoint to connect to (e.g. "tcp://192.168.173.13:8529").
@RESTBODYPARAM{database,string,required,string}
the database name on the master (if not specified, defaults to the
name of the local current database).
@RESTBODYPARAM{username,string,optional,string}
an optional ArangoDB username to use when connecting to the master.
@RESTBODYPARAM{password,string,required,string}
the password to use when connecting to the master.
@RESTBODYPARAM{includeSystem,boolean,required,}
whether or not system collection operations will be applied
@RESTBODYPARAM{restrictType,string,optional,string}
an optional string value for collection filtering. When
specified, the allowed values are *include* or *exclude*.
@RESTBODYPARAM{restrictCollections,array,optional,string}
an optional array of collections for use with *restrictType*.
If *restrictType* is *include*, only the specified collections
will be sychronised. If *restrictType* is *exclude*, all but the specified
collections will be synchronized.
@RESTBODYPARAM{maxConnectRetries,integer,optional,int64}
the maximum number of connection attempts the applier
will make in a row. If the applier cannot establish a connection to the
endpoint in this number of attempts, it will stop itself.
@RESTBODYPARAM{connectTimeout,integer,optional,int64}
the timeout (in seconds) when attempting to connect to the
endpoint. This value is used for each connection attempt.
@RESTBODYPARAM{requestTimeout,integer,optional,int64}
the timeout (in seconds) for individual requests to the endpoint.
@RESTBODYPARAM{chunkSize,integer,optional,int64}
the requested maximum size for log transfer packets that
is used when the endpoint is contacted.
@RESTBODYPARAM{adaptivePolling,boolean,optional,}
whether or not the replication applier will use adaptive polling.
@RESTBODYPARAM{autoResync,boolean,optional,}
whether or not the slave should perform an automatic resynchronization with
the master in case the master cannot serve log data requested by the slave,
or when the replication is started and no tick value can be found.
@RESTBODYPARAM{autoResyncRetries,integer,optional,int64}
number of resynchronization retries that will be performed in a row when
automatic resynchronization is enabled and kicks in. Setting this to *0* will
effectively disable *autoResync*. Setting it to some other value will limit
the number of retries that are performed. This helps preventing endless retries
in case resynchronizations always fail.
@RESTBODYPARAM{initialSyncMaxWaitTime,integer,optional,int64}
the maximum wait time (in seconds) that the initial synchronization will
wait for a response from the master when fetching initial collection data.
This wait time can be used to control after what time the initial synchronization
will give up waiting for a response and fail. This value is relevant even
for continuous replication when *autoResync* is set to *true* because this
may re-start the initial synchronization when the master cannot provide
log data the slave requires.
This value will be ignored if set to *0*.
@RESTBODYPARAM{connectionRetryWaitTime,integer,optional,int64}
the time (in seconds) that the applier will intentionally idle before
it retries connecting to the master in case of connection problems.
This value will be ignored if set to *0*.
@RESTBODYPARAM{idleMinWaitTime,integer,optional,int64}
the minimum wait time (in seconds) that the applier will intentionally idle
before fetching more log data from the master in case the master has
already sent all its log data. This wait time can be used to control the
frequency with which the replication applier sends HTTP log fetch requests
to the master in case there is no write activity on the master.
This value will be ignored if set to *0*.
@RESTBODYPARAM{idleMaxWaitTime,integer,optional,int64}
the maximum wait time (in seconds) that the applier will intentionally idle
before fetching more log data from the master in case the master has
already sent all its log data and there have been previous log fetch attempts
that resulted in no more log data. This wait time can be used to control the
maximum frequency with which the replication applier sends HTTP log fetch
requests to the master in case there is no write activity on the master for
longer periods. This configuration value will only be used if the option
*adaptivePolling* is set to *true*.
This value will be ignored if set to *0*.
@RESTBODYPARAM{requireFromPresent,boolean,optional,}
if set to *true*, then the replication applier will check
at start of its continuous replication if the start tick from the dump phase
is still present on the master. If not, then there would be data loss. If
*requireFromPresent* is *true*, the replication applier will abort with an
appropriate error message. If set to *false*, then the replication applier will
still start, and ignore the data loss.
@RESTBODYPARAM{verbose,boolean,optional,}
if set to *true*, then a log line will be emitted for all operations
performed by the replication applier. This should be used for debugging
replication
problems only.
@RESTDESCRIPTION
Starts a full data synchronization from a remote endpoint into the local ArangoDB
database and afterwards starts the continuous replication.
The operation works on a per-database level.
All local database data will be removed prior to the synchronization.
In case of success, the body of the response is a JSON object with the following
attributes:
- *state*: a JSON object with the following sub-attributes:
- *running*: whether or not the applier is active and running
- *lastAppliedContinuousTick*: the last tick value from the continuous
replication log the applier has applied.
- *lastProcessedContinuousTick*: the last tick value from the continuous
replication log the applier has processed.
Regularly, the last applied and last processed tick values should be
identical. For transactional operations, the replication applier will first
process incoming log events before applying them, so the processed tick
value might be higher than the applied tick value. This will be the case
until the applier encounters the *transaction commit* log event for the
transaction.
- *lastAvailableContinuousTick*: the last tick value the remote server can
provide.
- *ticksBehind*: this attribute will be present only if the applier is currently
running. It will provide the number of log ticks between what the applier
has applied/seen and the last log tick value provided by the remote server.
If this value is zero, then both servers are in sync. If this is non-zero,
then the remote server has additional data that the applier has not yet
fetched and processed, or the remote server may have more data that is not
applicable to the applier.
Client applications can use it to determine approximately how far the applier
is behind the remote server, and can periodically check if the value is
increasing (applier is falling behind) or decreasing (applier is catching up).
Please note that as the remote server will only keep one last log tick value
for all of its databases, but replication may be restricted to just certain
databases on the applier, this value is more meaningful when the global applier
is used.
Additionally, the last log tick provided by the remote server may increase
due to writes into system collections that are not replicated due to replication
configuration. So the reported value may exaggerate the reality a bit for
some scenarios.
- *time*: the time on the applier server.
- *totalRequests*: the total number of requests the applier has made to the
endpoint.
- *totalFailedConnects*: the total number of failed connection attempts the
applier has made.
- *totalEvents*: the total number of log events the applier has processed.
- *totalOperationsExcluded*: the total number of log events excluded because
of *restrictCollections*.
- *progress*: a JSON object with details about the replication applier progress.
It contains the following sub-attributes if there is progress to report:
- *message*: a textual description of the progress
- *time*: the date and time the progress was logged
- *failedConnects*: the current number of failed connection attempts
- *lastError*: a JSON object with details about the last error that happened on
the applier. It contains the following sub-attributes if there was an error:
- *errorNum*: a numerical error code
- *errorMessage*: a textual error description
- *time*: the date and time the error occurred
In case no error has occurred, *lastError* will be empty.
- *server*: a JSON object with the following sub-attributes:
- *version*: the applier server's version
- *serverId*: the applier server's id
- *endpoint*: the endpoint the applier is connected to (if applier is
active) or will connect to (if applier is currently inactive)
- *database*: the name of the database the applier is connected to (if applier is
active) or will connect to (if applier is currently inactive)
Please note that all "tick" values returned do not have a specific unit. Tick
values are only meaningful when compared to each other. Higher tick values mean
"later in time" than lower tick values.
WARNING: calling this method will sychronize data from the collections found
on the remote master to the local ArangoDB database. All data in the local
collections will be purged and replaced with data from the master.
Use with caution!
Please also keep in mind that this command may take a long time to complete
and return. This is because it will first do a full data synchronization with
the master, which will take time roughly proportional to the amount of data.
**Note**: this method is not supported on a coordinator in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{400}
is returned if the configuration is incomplete or malformed.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred during sychronization or when starting the
continuous replication.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_logger_first_tick.md -->
@startDocuBlock get_api_replication_logger_first_tick
@brief Return the first available tick value from the server
@RESTHEADER{GET /_api/replication/logger-first-tick, Returns the first available tick value, handleCommandLoggerFirstTick}
@RESTDESCRIPTION
Returns the first available tick value that can be served from the server's
replication log. This method can be called by replication clients after to
determine if certain data (identified by a tick value) is still available
for replication.
The result is a JSON object containing the attribute *firstTick*. This
attribute contains the minimum tick value available in the server's
replication
log.
**Note**: this method is not supported on a coordinator in a cluster.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@RESTRETURNCODE{501}
is returned when this operation is called on a coordinator in a cluster.
@EXAMPLES
Returning the first available tick
<div class="example-container" id="RestReplicationLoggerFirstTick_container">
<a class="anchorjs-link " href="#RestReplicationLoggerFirstTick_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationLoggerFirstTick_long">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-first-tick</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"firstTick"</span> : <span class="hljs-string">"185805"</span>
}
</pre>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_logger_return_state.md -->
@startDocuBlock get_api_replication_logger_return_state
@brief returns the state of the replication logger
@RESTHEADER{GET /_api/replication/logger-state, Return replication logger state, handleCommandLoggerState}
@RESTDESCRIPTION
Returns the current state of the server's replication logger. The state will
include information about whether the logger is running and about the last
logged tick value. This tick value is important for incremental fetching of
data.
The body of the response contains a JSON object with the following
attributes:
- *state*: the current logger state as a JSON object with the following
sub-attributes:
- *running*: whether or not the logger is running
- *lastLogTick*: the tick value of the latest tick the logger has logged.
This value can be used for incremental fetching of log data.
- *totalEvents*: total number of events logged since the server was started.
The value is not reset between multiple stops and re-starts of the logger.
- *time*: the current date and time on the logger server
- *server*: a JSON object with the following sub-attributes:
- *version*: the logger server's version
- *serverId*: the logger server's id
- *clients*: returns the last fetch status by replication clients connected to
the logger. Each client is returned as a JSON object with the following attributes:
- *syncerId*: id of the client syncer
- *serverId*: server id of client
- *lastServedTick*: last tick value served to this client via the *logger-follow* API
- *time*: date and time when this client last called the *logger-follow* API
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the logger state could be determined successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if the logger state could not be determined.
@EXAMPLES
Returns the state of the replication logger.
<div class="example-container" id="RestReplicationLoggerStateActive_container">
<a class="anchorjs-link " href="#RestReplicationLoggerStateActive_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="RestReplicationLoggerStateActive_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-state</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"state"</span> : {
<span class="hljs-string">"running"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"lastLogTick"</span> : <span class="hljs-string">"188629"</span>,
<span class="hljs-string">"lastUncommittedLogTick"</span> : <span class="hljs-string">"188629"</span>,
<span class="hljs-string">"totalEvents"</span> : <span class="hljs-number">188629</span>,
<span class="hljs-string">"time"</span> : <span class="hljs-string">"2019-10-03T14:18:22Z"</span>
},
<span class="hljs-string">"server"</span> : {
<span class="hljs-string">"version"</span> : <span class="hljs-string">"3.5.1"</span>,
<span class="hljs-string">"serverId"</span> : <span class="hljs-string">"58093674171183"</span>,
<span class="hljs-string">"engine"</span> : <span class="hljs-string">"rocksdb"</span>
},
<span class="hljs-string">"clients"</span> : [ ]
}
</pre>
<div id="RestReplicationLoggerStateActive_container_collapse" onclick="$('#RestReplicationLoggerStateActive_long').hide(); $('#RestReplicationLoggerStateActive_short').show(); window.location.hash='RestReplicationLoggerStateActive_container';" class="example_show_button">Hide response body</div></div>
<div id="RestReplicationLoggerStateActive_short" onclick="$('#RestReplicationLoggerStateActive_short').hide(); $('#RestReplicationLoggerStateActive_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/replication/logger-state</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Replication/get_api_replication_cluster_inventory.md -->
@startDocuBlock get_api_replication_cluster_inventory
@brief returs an overview of collections and indexes in a cluster
@RESTHEADER{GET /_api/replication/clusterInventory, Return cluster inventory of collections and indexes, handleCommandClusterInventory}
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{includeSystem,boolean,optional}
Include system collections in the result. The default value is *true*.
@RESTDESCRIPTION
Returns the array of collections and indexes available on the cluster.
The response will be an array of JSON objects, one for each collection.
Each collection containscontains exactly two keys "parameters" and
"indexes". This
information comes from Plan/Collections/{DB-Name}/* in the agency,
just that the *indexes* attribute there is relocated to adjust it to
the data format of arangodump.
@RESTRETURNCODES
@RESTRETURNCODE{200}
is returned if the request was executed successfully.
@RESTRETURNCODE{405}
is returned when an invalid HTTP method is used.
@RESTRETURNCODE{500}
is returned if an error occurred while assembling the response.
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_list_http_examples.md -->
@startDocuBlock general_graph_list_http_examples
@brief Lists all graphs known to the graph module.
@RESTHEADER{GET /_api/gharial, List all graphs}
@RESTDESCRIPTION
Lists all graphs stored in this database.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the module is available and the graphs could be listed.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graphs,array,required,graph_list}
@RESTSTRUCT{graph,graph_list,object,optional,graph_representation}
The information about the newly created graph
@RESTSTRUCT{name,graph_representation,string,required,}
The name of the graph
@RESTSTRUCT{edgeDefinitions,graph_representation,array,required,graph_edge_definition}
An array of definitions for the relations of the graph.
Each has the following type:
@RESTSTRUCT{orphanCollections,graph_representation,array,required,string}
An array of additional vertex collections.
Documents within these collections do not have edges within this graph.
@RESTSTRUCT{numberOfShards,graph_representation,integer,required,}
Number of shards created for every new collection in the graph.
@RESTSTRUCT{replicationFactor,graph_representation,integer,required,}
The replication factor used for every new collection in the graph.
@RESTSTRUCT{_id,graph_representation,string,required,}
The internal id value of this graph.
@RESTSTRUCT{_rev,graph_representation,string,required,}
The revision of this graph. Can be used to make sure to not override
concurrent modifications to this graph.
@RESTSTRUCT{replicationFactor,graph_representation,integer,required,}
The replication factor used for every new collection in the graph.
@RESTSTRUCT{isSmart,graph_representation,boolean,required,}
Flag if the graph is a SmartGraph (Enterprise Edition only) or not.
@RESTSTRUCT{smartGraphAttribute,graph_representation,string,optional,}
The name of the sharding attribute in smart graph case (Enterprise Edition only)
@EXAMPLES
<div class="example-container" id="HttpGharialList_container">
<a class="anchorjs-link " href="#HttpGharialList_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialList_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"graphs"</span> : [
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"social"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/social"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wXC--A"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ]
},
{
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"routeplanner"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/routeplanner"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wXW--A"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"frenchHighway"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"frenchCity"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"frenchCity"</span>
]
},
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"germanHighway"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"germanCity"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"germanCity"</span>
]
},
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"internationalHighway"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"frenchCity"</span>,
<span class="hljs-string">"germanCity"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"frenchCity"</span>,
<span class="hljs-string">"germanCity"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ]
}
]
}
</pre>
<div id="HttpGharialList_container_collapse" onclick="$('#HttpGharialList_long').hide(); $('#HttpGharialList_short').show(); window.location.hash='HttpGharialList_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialList_short" onclick="$('#HttpGharialList_short').hide(); $('#HttpGharialList_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_get_http_examples.md -->
@startDocuBlock general_graph_vertex_get_http_examples
@brief fetches an existing vertex
@RESTHEADER{GET /_api/gharial/{graph}/vertex/{collection}/{vertex}, Get a vertex}
@RESTDESCRIPTION
Gets a vertex from the given collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the vertex collection the vertex belongs to.
@RESTURLPARAM{vertex,string,required}
The *_key* attribute of the vertex.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{rev,string,optional}
Must contain a revision.
If this is set a document is only returned if
it has exactly this revision.
Also see if-match header as an alternative to this.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is returned,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an query parameter *rev*.
@RESTHEADERPARAM{if-none-match,string,optional}
If the "If-None-Match" header is given, then it must contain exactly one Etag. The document is returned,
only if it has a different revision as the given Etag. Otherwise a HTTP 304 is returned.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the vertex could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The complete vertex.
@RESTRETURNCODE{304}
Returned if the if-none-match header is given and the
currently stored vertex still has this revision value.
So there was no update between the last time the vertex
was fetched by the caller.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to update vertices in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Read Only` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The vertex does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialGetVertex_container">
<a class="anchorjs-link " href="#HttpGharialGetVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialGetVertex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wWe---
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"vertex"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wWe---"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice"</span>
}
}
</pre>
<div id="HttpGharialGetVertex_container_collapse" onclick="$('#HttpGharialGetVertex_long').hide(); $('#HttpGharialGetVertex_short').show(); window.location.hash='HttpGharialGetVertex_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialGetVertex_short" onclick="$('#HttpGharialGetVertex_short').hide(); $('#HttpGharialGetVertex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wWe---
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_get_http_examples.md -->
@startDocuBlock general_graph_get_http_examples
@brief Get a graph from the graph module.
@RESTHEADER{GET /_api/gharial/{graph}, Get a graph}
@RESTDESCRIPTION
Selects information for a given graph.
Will return the edge definitions as well as the orphan collections.
Or returns a 404 if the graph does not exist.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returns the graph if it could be found.
The result will have the following format:
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the newly created graph
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialGetGraph_container">
<a class="anchorjs-link " href="#HttpGharialGetGraph_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialGetGraph_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/myGraph</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wV6--A"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/myGraph"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>
}
}
</pre>
<div id="HttpGharialGetGraph_container_collapse" onclick="$('#HttpGharialGetGraph_long').hide(); $('#HttpGharialGetGraph_short').show(); window.location.hash='HttpGharialGetGraph_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialGetGraph_short" onclick="$('#HttpGharialGetGraph_short').hide(); $('#HttpGharialGetGraph_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/myGraph</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_modify_http_examples.md -->
@startDocuBlock general_graph_vertex_modify_http_examples
@brief update an existing vertex
@RESTHEADER{PATCH /_api/gharial/{graph}/vertex/{collection}/{vertex}, Update a vertex}
@RESTDESCRIPTION
Updates the data of the specific vertex in the collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the vertex collection the vertex belongs to.
@RESTURLPARAM{vertex,string,required}
The *_key* attribute of the vertex.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{keepNull,boolean,optional}
Define if values set to null should be stored.
By default (true) the given documents attribute(s) will be set to null.
If this parameter is false the attribute(s) will instead be delete from the
document.
@RESTQUERYPARAM{returnOld,boolean,optional}
Define if a presentation of the deleted document should
be returned within the response object.
@RESTQUERYPARAM{returnNew,boolean,optional}
Define if a presentation of the new document should
be returned within the response object.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is updated,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTALLBODYPARAM{vertex,object,required}
The body has to contain a JSON object containing exactly the attributes that should be overwritten, all other attributes remain unchanged.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the vertex could be updated, and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The internal attributes for the vertex.
@RESTREPLYBODY{new,object,optional,vertex_representation}
The complete newly written vertex document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,vertex_representation}
The complete overwritten vertex document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{202}
Returned if the request was successful, and waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The internal attributes for the vertex.
@RESTREPLYBODY{new,object,optional,vertex_representation}
The complete newly written vertex document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,vertex_representation}
The complete overwritten vertex document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to update vertices in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The vertex to update does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialModifyVertex_container">
<a class="anchorjs-link " href="#HttpGharialModifyVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialModifyVertex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span> &lt;&lt;EOF
{
<span class="hljs-string">"age"</span> : <span class="hljs-number">26</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5waK--D
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"vertex"</span> : {
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF5waC---"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5waK--D"</span>
}
}
</pre>
<div id="HttpGharialModifyVertex_container_collapse" onclick="$('#HttpGharialModifyVertex_long').hide(); $('#HttpGharialModifyVertex_short').show(); window.location.hash='HttpGharialModifyVertex_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialModifyVertex_short" onclick="$('#HttpGharialModifyVertex_short').hide(); $('#HttpGharialModifyVertex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span> &lt;&lt;EOF
{
<span class="hljs-string">"age"</span> : <span class="hljs-number">26</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5waK--D
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_collection_remove_http_examples.md -->
@startDocuBlock general_graph_vertex_collection_remove_http_examples
@brief Remove a vertex collection form the graph.
@RESTHEADER{DELETE /_api/gharial/{graph}/vertex/{collection}, Remove vertex collection}
@RESTDESCRIPTION
Removes a vertex collection from the graph and optionally deletes the collection,
if it is not used in any other graph.
It can only remove vertex collections that are no longer part of edge definitions,
if they are used in edge definitions you are required to modify those first.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the vertex collection.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{dropCollection,boolean,optional}
Drop the collection as well.
Collection will only be dropped if it is not used in other graphs.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the vertex collection was removed from the graph successfully
and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the newly created graph
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the newly created graph
@RESTRETURNCODE{400}
Returned if the vertex collection is still used in an edge definition.
In this case it cannot be removed from the graph yet, it has to be
removed from the edge definition first.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to drop a vertex you at least need to have the following privileges:
1. `Administrate` access on the Database.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
You can remove vertex collections that are not used in any edge collection:
<div class="example-container" id="HttpGharialRemoveVertexCollection_container">
<a class="anchorjs-link " href="#HttpGharialRemoveVertexCollection_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialRemoveVertexCollection_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/otherVertices</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wcu--_
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"social"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wcu--_"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/social"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"social"</span>
}
}
</pre>
<div id="HttpGharialRemoveVertexCollection_container_collapse" onclick="$('#HttpGharialRemoveVertexCollection_long').hide(); $('#HttpGharialRemoveVertexCollection_short').show(); window.location.hash='HttpGharialRemoveVertexCollection_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialRemoveVertexCollection_short" onclick="$('#HttpGharialRemoveVertexCollection_short').hide(); $('#HttpGharialRemoveVertexCollection_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/otherVertices</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wcu--_
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
You cannot remove vertex collections that are used in edge collections:
<div class="example-container" id="HttpGharialRemoveVertexCollectionFailed_container">
<a class="anchorjs-link " href="#HttpGharialRemoveVertexCollectionFailed_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialRemoveVertexCollectionFailed_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/male</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"code"</span> : <span class="hljs-number">400</span>,
<span class="hljs-string">"error"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"errorMessage"</span> : <span class="hljs-string">"collection is not in list of orphan collections"</span>,
<span class="hljs-string">"errorNum"</span> : <span class="hljs-number">1928</span>
}
</pre>
<div id="HttpGharialRemoveVertexCollectionFailed_container_collapse" onclick="$('#HttpGharialRemoveVertexCollectionFailed_long').hide(); $('#HttpGharialRemoveVertexCollectionFailed_short').show(); window.location.hash='HttpGharialRemoveVertexCollectionFailed_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialRemoveVertexCollectionFailed_short" onclick="$('#HttpGharialRemoveVertexCollectionFailed_short').hide(); $('#HttpGharialRemoveVertexCollectionFailed_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/male</span>
HTTP/<span class="hljs-number">1.1</span> Bad Request
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_list_edge_http_examples.md -->
@startDocuBlock general_graph_list_edge_http_examples
@brief Lists all edge definitions
@RESTHEADER{GET /_api/gharial/{graph}/edge, List edge definitions}
@RESTDESCRIPTION
Lists all edge collections within this graph.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the edge definitions could be listed.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{collections,array,required,string}
The list of all vertex collections within this graph.
Includes collections in edgeDefinitions as well as orphans.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialListEdge_container">
<a class="anchorjs-link " href="#HttpGharialListEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialListEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"collections"</span> : [
<span class="hljs-string">"relation"</span>
]
}
</pre>
<div id="HttpGharialListEdge_container_collapse" onclick="$('#HttpGharialListEdge_long').hide(); $('#HttpGharialListEdge_short').show(); window.location.hash='HttpGharialListEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialListEdge_short" onclick="$('#HttpGharialListEdge_short').hide(); $('#HttpGharialListEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_definition_remove_http_examples.md -->
@startDocuBlock general_graph_edge_definition_remove_http_examples
@brief Remove an edge definition form the graph
@RESTHEADER{DELETE /_api/gharial/{graph}/edge/{definition}, Remove an edge definition from the graph}
@RESTDESCRIPTION
Remove one edge definition from the graph. This will only remove the
edge collection, the vertex collections remain untouched and can still
be used in your queries.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{definition,string,required}
The name of the edge collection used in the definition.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{dropCollections,boolean,optional}
Drop the collection as well.
Collection will only be dropped if it is not used in other graphs.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the edge definition could be removed from the graph
and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{202}
Returned if the edge definition could be removed from the graph and
waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to drop a vertex you at least need to have the following privileges:
1. `Administrate` access on the Database.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found,
or if no edge definition with this name is found in the graph.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialEdgeDefinitionRemove_container">
<a class="anchorjs-link " href="#HttpGharialEdgeDefinitionRemove_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialEdgeDefinitionRemove_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge/relation</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wUq--_
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"social"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [ ],
<span class="hljs-string">"orphanCollections"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wUq--_"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/social"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"social"</span>
}
}
</pre>
<div id="HttpGharialEdgeDefinitionRemove_container_collapse" onclick="$('#HttpGharialEdgeDefinitionRemove_long').hide(); $('#HttpGharialEdgeDefinitionRemove_short').show(); window.location.hash='HttpGharialEdgeDefinitionRemove_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialEdgeDefinitionRemove_short" onclick="$('#HttpGharialEdgeDefinitionRemove_short').hide(); $('#HttpGharialEdgeDefinitionRemove_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge/relation</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wUq--_
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_modify_http_examples.md -->
@startDocuBlock general_graph_edge_modify_http_examples
@brief modify an existing edge
@RESTHEADER{PATCH /_api/gharial/{graph}/edge/{collection}/{edge}, Modify an edge}
@RESTDESCRIPTION
Updates the data of the specific edge in the collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the edge collection the edge belongs to.
@RESTURLPARAM{edge,string,required}
The *_key* attribute of the vertex.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{keepNull,boolean,optional}
Define if values set to null should be stored.
By default (true) the given documents attribute(s) will be set to null.
If this parameter is false the attribute(s) will instead be deleted from the
document.
@RESTQUERYPARAM{returnOld,boolean,optional}
Define if a presentation of the deleted document should
be returned within the response object.
@RESTQUERYPARAM{returnNew,boolean,optional}
Define if a presentation of the new document should
be returned within the response object.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is updated,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTALLBODYPARAM{edge,object,required}
The body has to contain a JSON object containing exactly the attributes that should be overwritten, all other attributes remain unchanged.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the edge could be updated, and waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The internal attributes for the edge.
@RESTREPLYBODY{new,object,optional,edge_representation}
The complete newly written edge document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,edge_representation}
The complete overwritten edge document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The internal attributes for the edge.
@RESTREPLYBODY{new,object,optional,edge_representation}
The complete newly written edge document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,edge_representation}
The complete overwritten edge document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to update edges in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The edge to update does not exist.
* either `_from` or `_to` vertex does not exist (if updated).
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialPatchEdge_container">
<a class="anchorjs-link " href="#HttpGharialPatchEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialPatchEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation/68679</span> &lt;&lt;EOF
{
<span class="hljs-string">"since"</span> : <span class="hljs-string">"01.01.2001"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wb---_
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"edge"</span> : {
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/68679"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"68679"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF5wa6--C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wb---_"</span>
}
}
</pre>
<div id="HttpGharialPatchEdge_container_collapse" onclick="$('#HttpGharialPatchEdge_long').hide(); $('#HttpGharialPatchEdge_short').show(); window.location.hash='HttpGharialPatchEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialPatchEdge_short" onclick="$('#HttpGharialPatchEdge_short').hide(); $('#HttpGharialPatchEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PATCH --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation/68679</span> &lt;&lt;EOF
{
<span class="hljs-string">"since"</span> : <span class="hljs-string">"01.01.2001"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wb---_
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_delete_http_examples.md -->
@startDocuBlock general_graph_edge_delete_http_examples
@brief removes an edge from graph
@RESTHEADER{DELETE /_api/gharial/{graph}/edge/{collection}/{edge}, Remove an edge}
@RESTDESCRIPTION
Removes an edge from the collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the edge collection the edge belongs to.
@RESTURLPARAM{edge,string,required}
The *_key* attribute of the edge.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{returnOld,boolean,optional}
Define if a presentation of the deleted document should
be returned within the response object.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is updated,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the edge could be removed.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{removed,boolean,required,}
Is set to true if the remove was successful.
@RESTREPLYBODY{old,object,optional,edge_representation}
The complete deleted edge document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{removed,boolean,required,}
Is set to true if the remove was successful.
@RESTREPLYBODY{old,object,optional,edge_representation}
The complete deleted edge document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to delete vertices in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The edge to remove does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialDeleteEdge_container">
<a class="anchorjs-link " href="#HttpGharialDeleteEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialDeleteEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge/relation/68108</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"removed"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="HttpGharialDeleteEdge_container_collapse" onclick="$('#HttpGharialDeleteEdge_long').hide(); $('#HttpGharialDeleteEdge_short').show(); window.location.hash='HttpGharialDeleteEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialDeleteEdge_short" onclick="$('#HttpGharialDeleteEdge_short').hide(); $('#HttpGharialDeleteEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge/relation/68108</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_get_http_examples.md -->
@startDocuBlock general_graph_edge_get_http_examples
@brief fetch an edge
@RESTHEADER{GET /_api/gharial/{graph}/edge/{collection}/{edge}, Get an edge}
@RESTDESCRIPTION
Gets an edge from the given collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the edge collection the edge belongs to.
@RESTURLPARAM{edge,string,required}
The *_key* attribute of the edge.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{rev,string,optional}
Must contain a revision.
If this is set a document is only returned if
it has exactly this revision.
Also see if-match header as an alternative to this.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is returned,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTHEADERPARAM{if-none-match,string,optional}
If the "If-None-Match" header is given, then it must contain exactly one Etag. The document is returned,
only if it has a different revision as the given Etag. Otherwise a HTTP 304 is returned.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the edge could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The complete edge.
@RESTRETURNCODE{304}
Returned if the if-none-match header is given and the
currently stored edge still has this revision value.
So there was no update between the last time the edge
was fetched by the caller.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to update vertices in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Read Only` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The edge does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialGetEdge_container">
<a class="anchorjs-link " href="#HttpGharialGetEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialGetEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge/relation/68295</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wVS---
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"edge"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"68295"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/68295"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wVS---"</span>,
<span class="hljs-string">"type"</span> : <span class="hljs-string">"married"</span>,
<span class="hljs-string">"vertex"</span> : <span class="hljs-string">"alice"</span>
}
}
</pre>
<div id="HttpGharialGetEdge_container_collapse" onclick="$('#HttpGharialGetEdge_long').hide(); $('#HttpGharialGetEdge_short').show(); window.location.hash='HttpGharialGetEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialGetEdge_short" onclick="$('#HttpGharialGetEdge_short').hide(); $('#HttpGharialGetEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/edge/relation/68295</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wVS---
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_create_http_examples.md -->
@startDocuBlock general_graph_create_http_examples
@brief Create a new graph in the graph module.
@RESTHEADER{POST /_api/gharial, Create a graph}
@RESTDESCRIPTION
The creation of a graph requires the name of the graph and a
definition of its edges.
[See also edge definitions](../../Manual/Graphs/GeneralGraphs/Management.html#edge-definitions).
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
define if the request should wait until everything is synced to disc.
Will change the success response code.
@RESTBODYPARAM{name,string,required,string}
Name of the graph.
@RESTBODYPARAM{edgeDefinitions,array,optional,graph_edge_definition}
An array of definitions for the relations of the graph.
Each has the following type:
@RESTBODYPARAM{isSmart,boolean,optional,boolean}
Define if the created graph should be smart.
This only has effect in Enterprise Edition.
@RESTBODYPARAM{options,object,optional,post_api_gharial_create_opts}
a JSON object to define options for creating collections within this graph.
It can contain the following attributes:
@RESTSTRUCT{smartGraphAttribute,post_api_gharial_create_opts,string,optional,}
Only has effect in Enterprise Edition and it is required if isSmart is true.
The attribute name that is used to smartly shard the vertices of a graph.
Every vertex in this SmartGraph has to have this attribute.
Cannot be modified later.
@RESTSTRUCT{numberOfShards,post_api_gharial_create_opts,integer,required,}
The number of shards that is used for every collection within this graph.
Cannot be modified later.
@RESTSTRUCT{replicationFactor,post_api_gharial_create_opts,integer,required,}
The replication factor used when initially creating collections for this graph.
@RESTSTRUCT{minReplicationFactor,post_api_gharial_create_opts,integer,optional,}
The minimal replication factor used for every new collection in the graph.
If one shard has less than minReplicationFactor copies, we cannot write
to this shard, but to all others.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Is returned if the graph could be created and waitForSync is enabled
for the `_graphs` collection, or given in the request.
The response body contains the graph configuration that has been stored.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the newly created graph.
@RESTRETURNCODE{202}
Is returned if the graph could be created and waitForSync is disabled
for the `_graphs` collection and not given in the request.
The response body contains the graph configuration that has been stored.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the newly created graph.
@RESTRETURNCODE{400}
Returned if the request is in a wrong format.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to create a graph you at least need to have the following privileges:
1. `Administrate` access on the Database.
2. `Read Only` access on every collection used within this graph.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{409}
Returned if there is a conflict storing the graph. This can occur
either if a graph with this name is already stored, or if there is one
edge definition with a the same
[edge collection](../../Manual/Appendix/Glossary.html#edge-collection) but a
different signature used in any other graph.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialCreate_container">
<a class="anchorjs-link " href="#HttpGharialCreate_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialCreate_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wRe--A
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wRe--A"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/myGraph"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>
}
}
</pre>
<div id="HttpGharialCreate_container_collapse" onclick="$('#HttpGharialCreate_long').hide(); $('#HttpGharialCreate_short').show(); window.location.hash='HttpGharialCreate_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialCreate_short" onclick="$('#HttpGharialCreate_short').hide(); $('#HttpGharialCreate_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wRe--A
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
<div class="example-container" id="HttpGharialCreate2_container">
<a class="anchorjs-link " href="#HttpGharialCreate2_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialCreate2_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
],
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"smartGraphAttribute"</span> : <span class="hljs-string">"region"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wR2--A
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wR2--A"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/myGraph"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>
}
}
</pre>
<div id="HttpGharialCreate2_container_collapse" onclick="$('#HttpGharialCreate2_long').hide(); $('#HttpGharialCreate2_short').show(); window.location.hash='HttpGharialCreate2_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialCreate2_short" onclick="$('#HttpGharialCreate2_short').hide(); $('#HttpGharialCreate2_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"myGraph"</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"edges"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"startVertices"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"endVertices"</span>
]
}
],
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">true</span>,
<span class="hljs-string">"options"</span> : {
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">2</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">9</span>,
<span class="hljs-string">"smartGraphAttribute"</span> : <span class="hljs-string">"region"</span>
}
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wR2--A
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_replace_http_examples.md -->
@startDocuBlock general_graph_edge_replace_http_examples
@brief replace the content of an existing edge
@RESTHEADER{PUT /_api/gharial/{graph}/edge/{collection}/{edge}, Replace an edge}
@RESTDESCRIPTION
Replaces the data of an edge in the collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the edge collection the edge belongs to.
@RESTURLPARAM{edge,string,required}
The *_key* attribute of the vertex.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{keepNull,boolean,optional}
Define if values set to null should be stored. By default the key is not removed from the document.
@RESTQUERYPARAM{returnOld,boolean,optional}
Define if a presentation of the deleted document should
be returned within the response object.
@RESTQUERYPARAM{returnNew,boolean,optional}
Define if a presentation of the new document should
be returned within the response object.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is updated,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTBODYPARAM{_from,string,required,}
The source vertex of this edge. Has to be valid within
the used edge definition.
@RESTBODYPARAM{_to,string,required,}
The target vertex of this edge. Has to be valid within
the used edge definition.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the request was successful but waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The internal attributes for the edge
@RESTREPLYBODY{new,object,optional,edge_representation}
The complete newly written edge document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,edge_representation}
The complete overwritten edge document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The internal attributes for the edge
@RESTREPLYBODY{new,object,optional,edge_representation}
The complete newly written edge document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,edge_representation}
The complete overwritten edge document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to replace edges in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The edge to replace does not exist.
* either `_from` or `_to` vertex does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialPutEdge_container">
<a class="anchorjs-link " href="#HttpGharialPutEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialPutEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation/68723</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"divorced"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wby--_
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"edge"</span> : {
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/68723"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"68723"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF5wbq--C"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wby--_"</span>
}
}
</pre>
<div id="HttpGharialPutEdge_container_collapse" onclick="$('#HttpGharialPutEdge_long').hide(); $('#HttpGharialPutEdge_short').show(); window.location.hash='HttpGharialPutEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialPutEdge_short" onclick="$('#HttpGharialPutEdge_short').hide(); $('#HttpGharialPutEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation/68723</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"divorced"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"male/bob"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wby--_
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_definition_add_http_examples.md -->
@startDocuBlock general_graph_edge_definition_add_http_examples
@brief Add a new edge definition to the graph
@RESTHEADER{POST /_api/gharial/{graph}/edge, Add edge definition}
@RESTDESCRIPTION
Adds an additional edge definition to the graph.
This edge definition has to contain a *collection* and an array of
each *from* and *to* vertex collections. An edge definition can only
be added if this definition is either not used in any other graph, or
it is used with exactly the same definition. It is not possible to
store a definition "e" from "v1" to "v2" in the one graph, and "e"
from "v2" to "v1" in the other graph.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTBODYPARAM{collection,string,required,string}
The name of the edge collection to be used.
@RESTBODYPARAM{from,array,required,string}
One or many vertex collections that can contain source vertices.
@RESTBODYPARAM{to,array,required,string}
One or many vertex collections that can contain target vertices.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the definition could be added successfully and
waitForSync is enabled for the `_graphs` collection.
The response body contains the graph configuration that has been stored.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{202}
Returned if the definition could be added successfully and
waitForSync is disabled for the `_graphs` collection.
The response body contains the graph configuration that has been stored.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{400}
Returned if the definition could not be added.
This could be because it is ill-formed, or
if the definition is used in an other graph with a different signature.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to modify a graph you at least need to have the following privileges:
1. `Administrate` access on the Database.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialAddEdgeCol_container">
<a class="anchorjs-link " href="#HttpGharialAddEdgeCol_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialAddEdgeCol_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"works_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wPm--B
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"social"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
]
},
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"works_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wPm--B"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/social"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"social"</span>
}
}
</pre>
<div id="HttpGharialAddEdgeCol_container_collapse" onclick="$('#HttpGharialAddEdgeCol_long').hide(); $('#HttpGharialAddEdgeCol_short').show(); window.location.hash='HttpGharialAddEdgeCol_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialAddEdgeCol_short" onclick="$('#HttpGharialAddEdgeCol_short').hide(); $('#HttpGharialAddEdgeCol_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"works_in"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"city"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wPm--B
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_drop_http_examples.md -->
@startDocuBlock general_graph_drop_http_examples
@brief delete an existing graph
@RESTHEADER{DELETE /_api/gharial/{graph}, Drop a graph}
@RESTDESCRIPTION
Drops an existing graph object by name.
Optionally all collections not used by other graphs
can be dropped as well.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{dropCollections,boolean,optional}
Drop collections of this graph as well. Collections will only be
dropped if they are not used in other graphs.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Is returned if the graph could be dropped and waitForSync is enabled
for the `_graphs` collection, or given in the request.
@RESTRETURNCODE{202}
Is returned if the graph could be dropped and waitForSync is disabled
for the `_graphs` collection and not given in the request.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to drop a graph you at least need to have the following privileges:
1. `Administrate` access on the Database.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialDrop_container">
<a class="anchorjs-link " href="#HttpGharialDrop_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialDrop_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social?dropCollections=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"removed"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="HttpGharialDrop_container_collapse" onclick="$('#HttpGharialDrop_long').hide(); $('#HttpGharialDrop_short').show(); window.location.hash='HttpGharialDrop_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialDrop_short" onclick="$('#HttpGharialDrop_short').hide(); $('#HttpGharialDrop_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social?dropCollections=<span class="hljs-literal">true</span></span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_collection_add_http_examples.md -->
@startDocuBlock general_graph_vertex_collection_add_http_examples
@brief Add an additional vertex collection to the graph.
@RESTHEADER{POST /_api/gharial/{graph}/vertex, Add vertex collection}
@RESTDESCRIPTION
Adds a vertex collection to the set of orphan collections of the graph.
If the collection does not exist, it will be created.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Is returned if the collection could be created and waitForSync is enabled
for the `_graphs` collection, or given in the request.
The response body contains the graph configuration that has been stored.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{202}
Is returned if the collection could be created and waitForSync is disabled
for the `_graphs` collection, or given in the request.
The response body contains the graph configuration that has been stored.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the newly created graph
@RESTRETURNCODE{400}
Returned if the request is in an invalid format.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to modify a graph you at least need to have the following privileges:
1. `Administrate` access on the Database.
2. `Read Only` access on every collection used within this graph.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialAddVertexCol_container">
<a class="anchorjs-link " href="#HttpGharialAddVertexCol_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialAddVertexCol_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"otherVertices"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wRC--_
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"social"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [
<span class="hljs-string">"otherVertices"</span>
],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wRC--_"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/social"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"social"</span>
}
}
</pre>
<div id="HttpGharialAddVertexCol_container_collapse" onclick="$('#HttpGharialAddVertexCol_long').hide(); $('#HttpGharialAddVertexCol_short').show(); window.location.hash='HttpGharialAddVertexCol_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialAddVertexCol_short" onclick="$('#HttpGharialAddVertexCol_short').hide(); $('#HttpGharialAddVertexCol_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"otherVertices"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wRC--_
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_create_http_examples.md -->
@startDocuBlock general_graph_vertex_create_http_examples
@brief create a new vertex
@RESTHEADER{POST /_api/gharial/{graph}/vertex/{collection}, Create a vertex}
@RESTDESCRIPTION
Adds a vertex to the given collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the vertex collection the vertex should be inserted into.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{returnNew,boolean,optional}
Define if the response should contain the complete
new version of the document.
@RESTALLBODYPARAM{vertex,object,required}
The body has to be the JSON object to be stored.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the vertex could be added and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The internal attributes for the vertex.
@RESTREPLYBODY{new,object,optional,vertex_representation}
The complete newly written vertex document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The internal attributes generated while storing the vertex.
Does not include any attribute given in request body.
@RESTREPLYBODY{new,object,optional,vertex_representation}
The complete newly written vertex document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to insert vertices into the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
Or if a graph is found but this collection is not part of the graph.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialAddVertex_container">
<a class="anchorjs-link " href="#HttpGharialAddVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialAddVertex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/male</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Francis"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wQW--C
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"vertex"</span> : {
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"male/67958"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"67958"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wQW--C"</span>
}
}
</pre>
<div id="HttpGharialAddVertex_container_collapse" onclick="$('#HttpGharialAddVertex_long').hide(); $('#HttpGharialAddVertex_short').show(); window.location.hash='HttpGharialAddVertex_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialAddVertex_short" onclick="$('#HttpGharialAddVertex_short').hide(); $('#HttpGharialAddVertex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/male</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Francis"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wQW--C
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_list_vertex_http_examples.md -->
@startDocuBlock general_graph_list_vertex_http_examples
@brief Lists all vertex collections used in this graph.
@RESTHEADER{GET /_api/gharial/{graph}/vertex, List vertex collections}
@RESTDESCRIPTION
Lists all vertex collections within this graph.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Is returned if the collections could be listed.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{collections,array,required,string}
The list of all vertex collections within this graph.
Includes collections in edgeDefinitions as well as orphans.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialListVertex_container">
<a class="anchorjs-link " href="#HttpGharialListVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialListVertex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">200</span>,
<span class="hljs-string">"collections"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
]
}
</pre>
<div id="HttpGharialListVertex_container_collapse" onclick="$('#HttpGharialListVertex_long').hide(); $('#HttpGharialListVertex_short').show(); window.location.hash='HttpGharialListVertex_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialListVertex_short" onclick="$('#HttpGharialListVertex_short').hide(); $('#HttpGharialListVertex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex</span>
HTTP/<span class="hljs-number">1.1</span> OK
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_delete_http_examples.md -->
@startDocuBlock general_graph_vertex_delete_http_examples
@brief removes a vertex from a graph
@RESTHEADER{DELETE /_api/gharial/{graph}/vertex/{collection}/{vertex}, Remove a vertex}
@RESTDESCRIPTION
Removes a vertex from the collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the vertex collection the vertex belongs to.
@RESTURLPARAM{vertex,string,required}
The *_key* attribute of the vertex.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{returnOld,boolean,optional}
Define if a presentation of the deleted document should
be returned within the response object.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is updated,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the vertex could be removed.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{removed,boolean,required,}
Is set to true if the remove was successful.
@RESTREPLYBODY{old,object,optional,vertex_representation}
The complete deleted vertex document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{removed,boolean,required,}
Is set to true if the remove was successful.
@RESTREPLYBODY{old,object,optional,vertex_representation}
The complete deleted vertex document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to delete vertices in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The vertex to remove does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialDeleteVertex_container">
<a class="anchorjs-link " href="#HttpGharialDeleteVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialDeleteVertex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"removed"</span> : <span class="hljs-literal">true</span>
}
</pre>
<div id="HttpGharialDeleteVertex_container_collapse" onclick="$('#HttpGharialDeleteVertex_long').hide(); $('#HttpGharialDeleteVertex_short').show(); window.location.hash='HttpGharialDeleteVertex_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialDeleteVertex_short" onclick="$('#HttpGharialDeleteVertex_short').hide(); $('#HttpGharialDeleteVertex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X DELETE --header <span class="hljs-string">'accept: application/json'</span> --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span>
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_definition_modify_http_examples.md -->
@startDocuBlock general_graph_edge_definition_modify_http_examples
@brief Replace an existing edge definition
@RESTHEADER{PUT /_api/gharial/{graph}/edge/{definition}, Replace an edge definition}
@RESTDESCRIPTION
Change one specific edge definition.
This will modify all occurrences of this definition in all graphs known to your database.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{definition,string,required}
The name of the edge collection used in the definition.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{dropCollections,boolean,optional}
Drop the collection as well.
Collection will only be dropped if it is not used in other graphs.
@RESTBODYPARAM{collection,string,required,string}
The name of the edge collection to be used.
@RESTBODYPARAM{from,array,required,string}
One or many vertex collections that can contain source vertices.
@RESTBODYPARAM{to,array,required,string}
One or many vertex collections that can contain target vertices.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the request was successful and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{graph,object,required,graph_representation}
The information about the modified graph.
@RESTRETURNCODE{400}
Returned if no edge definition with this name is found in the graph,
or of the new definition is ill-formed and cannot be used.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to drop a vertex you at least need to have the following privileges:
1. `Administrate` access on the Database.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned if no graph with this name could be found.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialReplaceEdgeCol_container">
<a class="anchorjs-link " href="#HttpGharialReplaceEdgeCol_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialReplaceEdgeCol_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>,
<span class="hljs-string">"animal"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>,
<span class="hljs-string">"animal"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5weS--D
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"graph"</span> : {
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"social"</span>,
<span class="hljs-string">"numberOfShards"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"replicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"minReplicationFactor"</span> : <span class="hljs-number">1</span>,
<span class="hljs-string">"isSmart"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"edgeDefinitions"</span> : [
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"animal"</span>,
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"animal"</span>,
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>
]
}
],
<span class="hljs-string">"orphanCollections"</span> : [ ],
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5weS--D"</span>,
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"_graphs/social"</span>,
<span class="hljs-string">"name"</span> : <span class="hljs-string">"social"</span>
}
}
</pre>
<div id="HttpGharialReplaceEdgeCol_container_collapse" onclick="$('#HttpGharialReplaceEdgeCol_long').hide(); $('#HttpGharialReplaceEdgeCol_short').show(); window.location.hash='HttpGharialReplaceEdgeCol_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialReplaceEdgeCol_short" onclick="$('#HttpGharialReplaceEdgeCol_short').hide(); $('#HttpGharialReplaceEdgeCol_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation</span> &lt;&lt;EOF
{
<span class="hljs-string">"collection"</span> : <span class="hljs-string">"relation"</span>,
<span class="hljs-string">"from"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>,
<span class="hljs-string">"animal"</span>
],
<span class="hljs-string">"to"</span> : [
<span class="hljs-string">"female"</span>,
<span class="hljs-string">"male"</span>,
<span class="hljs-string">"animal"</span>
]
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5weS--D
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_vertex_replace_http_examples.md -->
@startDocuBlock general_graph_vertex_replace_http_examples
@brief replaces an existing vertex
@RESTHEADER{PUT /_api/gharial/{graph}/vertex/{collection}/{vertex}, Replace a vertex}
@RESTDESCRIPTION
Replaces the data of a vertex in the collection.
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the vertex collection the vertex belongs to.
@RESTURLPARAM{vertex,string,required}
The *_key* attribute of the vertex.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{keepNull,boolean,optional}
Define if values set to null should be stored. By default the key is not removed from the document.
@RESTQUERYPARAM{returnOld,boolean,optional}
Define if a presentation of the deleted document should
be returned within the response object.
@RESTQUERYPARAM{returnNew,boolean,optional}
Define if a presentation of the new document should
be returned within the response object.
@RESTHEADERPARAMETERS
@RESTHEADERPARAM{if-match,string,optional}
If the "If-Match" header is given, then it must contain exactly one Etag. The document is updated,
if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned. As an alternative
you can supply the Etag in an attribute rev in the URL.
@RESTALLBODYPARAM{vertex,object,required}
The body has to be the JSON object to be stored.
@RESTRETURNCODES
@RESTRETURNCODE{200}
Returned if the vertex could be replaced, and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The internal attributes for the vertex.
@RESTREPLYBODY{new,object,optional,vertex_representation}
The complete newly written vertex document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,vertex_representation}
The complete overwritten vertex document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{202}
Returned if the vertex could be replaced, and waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{vertex,object,required,vertex_representation}
The internal attributes for the vertex.
@RESTREPLYBODY{new,object,optional,vertex_representation}
The complete newly written vertex document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTREPLYBODY{old,object,optional,vertex_representation}
The complete overwritten vertex document.
Includes all attributes stored before this operation.
Will only be present if returnOld is true.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to replace vertices in the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in the following cases:
* No graph with this name could be found.
* This collection is not part of the graph.
* The vertex to replace does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{412}
Returned if if-match header is given, but the stored documents revision is different.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialReplaceVertex_container">
<a class="anchorjs-link " href="#HttpGharialReplaceVertex_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialReplaceVertex_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice Cooper"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">26</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wfC--F
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"vertex"</span> : {
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"alice"</span>,
<span class="hljs-string">"_oldRev"</span> : <span class="hljs-string">"_ZXF5we6---"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wfC--F"</span>
}
}
</pre>
<div id="HttpGharialReplaceVertex_container_collapse" onclick="$('#HttpGharialReplaceVertex_long').hide(); $('#HttpGharialReplaceVertex_short').show(); window.location.hash='HttpGharialReplaceVertex_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialReplaceVertex_short" onclick="$('#HttpGharialReplaceVertex_short').hide(); $('#HttpGharialReplaceVertex_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X PUT --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/vertex/female/alice</span> &lt;&lt;EOF
{
<span class="hljs-string">"name"</span> : <span class="hljs-string">"Alice Cooper"</span>,
<span class="hljs-string">"age"</span> : <span class="hljs-number">26</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wfC--F
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock
<!-- filename: /work/ArangoDB/Documentation/DocuBlocks/Rest/Graph/general_graph_edge_create_http_examples.md -->
@startDocuBlock general_graph_edge_create_http_examples
@brief Creates an edge in an existing graph
@RESTHEADER{POST /_api/gharial/{graph}/edge/{collection}, Create an edge}
@RESTDESCRIPTION
Creates a new edge in the collection.
Within the body the edge has to contain a *_from* and *_to* value referencing to valid vertices in the graph.
Furthermore the edge has to be valid in the definition of the used
[edge collection](../../Manual/Appendix/Glossary.html#edge-collection).
@RESTURLPARAMETERS
@RESTURLPARAM{graph,string,required}
The name of the graph.
@RESTURLPARAM{collection,string,required}
The name of the edge collection the edge belongs to.
@RESTQUERYPARAMETERS
@RESTQUERYPARAM{waitForSync,boolean,optional}
Define if the request should wait until synced to disk.
@RESTQUERYPARAM{returnNew,boolean,optional}
Define if the response should contain the complete
new version of the document.
@RESTBODYPARAM{_from,string,required,}
The source vertex of this edge. Has to be valid within
the used edge definition.
@RESTBODYPARAM{_to,string,required,}
The target vertex of this edge. Has to be valid within
the used edge definition.
@RESTRETURNCODES
@RESTRETURNCODE{201}
Returned if the edge could be created and waitForSync is true.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The internal attributes for the edge.
@RESTREPLYBODY{new,object,optional,edge_representation}
The complete newly written edge document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTRETURNCODE{202}
Returned if the request was successful but waitForSync is false.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is false in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{edge,object,required,edge_representation}
The internal attributes for the edge.
@RESTREPLYBODY{new,object,optional,edge_representation}
The complete newly written edge document.
Includes all written attributes in the request body
and all internal attributes generated by ArangoDB.
Will only be present if returnNew is true.
@RESTRETURNCODE{400}
Returned if the input document is invalid.
This can for instance be the case if `_from` or `_to` is mising.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{403}
Returned if your user has insufficient rights.
In order to insert edges into the graph you at least need to have the following privileges:
1. `Read Only` access on the Database.
2. `Write` access on the given collection.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@RESTRETURNCODE{404}
Returned in any of the following cases:
* no graph with this name could be found.
* this edge collection is not part of the graph.
* either `_from` or `_to` vertex does not exist.
@RESTREPLYBODY{error,boolean,required,}
Flag if there was an error (true) or not (false).
It is true in this response.
@RESTREPLYBODY{code,integer,required,}
The response code.
@RESTREPLYBODY{errorNum,integer,required,}
ArangoDB error number for the error that occured.
@RESTREPLYBODY{errorMessage,string,required,}
A message created for this error.
@EXAMPLES
<div class="example-container" id="HttpGharialAddEdge_container">
<a class="anchorjs-link " href="#HttpGharialAddEdge_container" aria-label="Anchor" data-anchorjs-icon=""></a><div id="HttpGharialAddEdge_long" style="Display: none;">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wOy---
x-content-type-options: nosniff
{
<span class="hljs-string">"error"</span> : <span class="hljs-literal">false</span>,
<span class="hljs-string">"code"</span> : <span class="hljs-number">202</span>,
<span class="hljs-string">"edge"</span> : {
<span class="hljs-string">"_id"</span> : <span class="hljs-string">"relation/67847"</span>,
<span class="hljs-string">"_key"</span> : <span class="hljs-string">"67847"</span>,
<span class="hljs-string">"_rev"</span> : <span class="hljs-string">"_ZXF5wOy---"</span>
}
}
</pre>
<div id="HttpGharialAddEdge_container_collapse" onclick="$('#HttpGharialAddEdge_long').hide(); $('#HttpGharialAddEdge_short').show(); window.location.hash='HttpGharialAddEdge_container';" class="example_show_button">Hide response body</div></div>
<div id="HttpGharialAddEdge_short" onclick="$('#HttpGharialAddEdge_short').hide(); $('#HttpGharialAddEdge_long').show();">
<pre>
<span class="hljs-meta">shell&gt;</span><span class="bash"> curl -X POST --header <span class="hljs-string">'accept: application/json'</span> --data-binary @- --dump - http://localhost:8529/_api/gharial/social/edge/relation</span> &lt;&lt;EOF
{
<span class="hljs-string">"type"</span> : <span class="hljs-string">"friend"</span>,
<span class="hljs-string">"_from"</span> : <span class="hljs-string">"female/alice"</span>,
<span class="hljs-string">"_to"</span> : <span class="hljs-string">"female/diana"</span>
}
EOF
HTTP/<span class="hljs-number">1.1</span> Accepted
content-type: application/json; charset=utf<span class="hljs-number">-8</span>
etag: _ZXF5wOy---
x-content-type-options: nosniff
</pre><div class="example_show_button">Show response body</div>
</div>
</div>
@endDocuBlock