1
0
Fork 0

slightly improved AQL documentation

Conflicts:
	Documentation/UserManual/Aql.md
This commit is contained in:
Jan Steemann 2014-02-28 20:17:45 +01:00
parent a1dc22e11b
commit 87284a47f9
2 changed files with 140 additions and 113 deletions

View File

@ -1219,7 +1219,8 @@ AQL supports the following functions to operate on document values:
Example usage:
RETURN MATCHES({ "test" : 1 }, [
RETURN MATCHES(
{ "test" : 1 }, [
{ "test" : 1, "foo" : "bar" },
{ "foo" : 1 },
{ "test : 1 }
@ -1239,17 +1240,23 @@ AQL supports the following functions to operate on document values:
{ "user1" : { "name" : "J" } },
{ "user2" : { "name" : "T" } }
)
[ { "user1" : { "name" : "J" },
"user2" : { "name" : "T" } } ]
[
{ "user1" : { "name" : "J" },
"user2" : { "name" : "T" } }
]
When merging documents with identical attribute names, the attribute values of the
latter documents will be used in the end result:
return MERGE(
RETURN MERGE(
{ "users" : { "name" : "J" } },
{ "users" : { "name" : "T" } }
)
[ { "users" : { "name" : "T" } } ]
[
{ "users" : { "name" : "T" } }
]
Please note that merging will only be done for top-level attributes. If you wish to
merge sub-attributes, you should consider using `MERGE_RECURSIVE` instead.
@ -1265,7 +1272,10 @@ AQL supports the following functions to operate on document values:
{ "user-1" : { "name" : "J", "livesIn" : { "city" : "LA" } } },
{ "user-1" : { "age" : 42, "livesIn" : { "state" : "CA" } } }
)
[ { "user-1" : { "name" : "J", "livesIn" : { "city" : "LA", "state" : "CA" }, "age" : 42 } } ]
[
{ "user-1" : { "name" : "J", "livesIn" : { "city" : "LA", "state" : "CA" }, "age" : 42 } }
]
- @FN{HAS(@FA{document}, @FA{attributename})}: returns `true` if @FA{document} has an
@ -1299,10 +1309,16 @@ AQL supports the following functions to operate on document values:
document without an `_id` attribute will result in an error.
RETURN PARSE_IDENTIFIER('_users/my-user')
[ { "collection" : "_users", "key" : "my-user" } ]
[
{ "collection" : "_users", "key" : "my-user" }
]
RETURN PARSE_IDENTIFIER({ "_id" : "mycollection/mykey", "value" : "some value" })
[ { "collection" : "mycollection", "key" : "mykey" } ]
[
{ "collection" : "mycollection", "key" : "mykey" }
]
@subsubsection AqlFunctionsGeo Geo functions
@ -1411,7 +1427,7 @@ AQL has the following functions to traverse graphs:
- `source`: start vertex of path
- `destination`: destination vertex of path
Example calls:
Example calls:
PATHS(friends, friendrelations, "outbound", false)
@ -1505,7 +1521,7 @@ Example calls:
attributes `vertices` and `edges`, which are both lists. Note that `path` is only present
in the result if the `paths` attribute is set in the @FA{options}.
Example calls:
Example calls:
TRAVERSAL(friends, friendrelations, "friends/john", "outbound", {
strategy: "depthfirst",
@ -1566,7 +1582,7 @@ Example calls:
be set up in a way that resembles a depth-first, pre-order visitation result. Thus, the
`strategy` and `order` attributes of the @FA{options} attribute will be ignored.
Example calls:
Example calls:
TRAVERSAL_TREE(friends, friendrelations, "friends/john", "outbound", "likes", {
itemOrder: "forward"
@ -1647,7 +1663,7 @@ time and memory for the result set.
attributes `vertices` and `edges`, which are both lists. Note that `path` is only present
in the result if the `paths` attribute is set in the @FA{options}.
Example calls:
Example calls:
SHORTEST_PATH(cities, motorways, "cities/CGN", "cities/MUC", "outbound", {
paths: true
@ -1691,7 +1707,7 @@ Example calls:
To not restrict the result to specific connections, @FA{edgeexamples} should be left
unspecified.
Example calls:
Example calls:
EDGES(friendrelations, "friends/john", "outbound")
EDGES(friendrelations, "friends/john", "any", [ { "$label": "knows" } ])
@ -1708,7 +1724,7 @@ Example calls:
To not restrict the result to specific connections, @FA{edgeexamples} should be left
unspecified.
Example calls:
Example calls:
NEIGHBORS(friends, friendrelations, "friends/john", "outbound")
NEIGHBORS(users, usersrelations, "users/john", "any", [ { "$label": "recommends" } ] )

View File

@ -16,6 +16,17 @@ TOC {#AqlTOC}
- @ref AqlData
- @ref AqlOperators
- @ref AqlFunctions
- @ref AqlFunctionsCasting
- @ref AqlFunctionsChecking
- @ref AqlFunctionsString
- @ref AqlFunctionsNumeric
- @ref AqlFunctionsList
- @ref AqlFunctionsDocument
- @ref AqlFunctionsGeo
- @ref AqlFunctionsFulltext
- @ref AqlFunctionsGraph
- @ref AqlFunctionsControl
- @ref AqlFunctionsMisc
- @ref AqlOperations
- @ref AqlOperationFor
- @ref AqlOperationReturn