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

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