Skip to content

Commit

Permalink
ArangoDB queries and joins
Browse files Browse the repository at this point in the history
  • Loading branch information
adigenova committed Jul 12, 2022
1 parent bc4f5d6 commit 328ec5c
Showing 1 changed file with 9 additions and 48 deletions.
57 changes: 9 additions & 48 deletions code/NoSQL_ArangoDB_ejemplo.ipynb
Original file line number Diff line number Diff line change
@@ -312,27 +312,6 @@
" print(doc)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "khbGt6zud50q"
},
"source": [
"The document features the four attributes we stored, plus three more added by the database system. Each document needs a unique `_key`, which identifies it within a collection. The `_id` is a computed property, a concatenation of the collection name, a forward slash `/` and the document key. It uniquely identies a document within a database. `_rev` is a revision ID managed by the system. Older revisions of a document cannot be accessed.\n",
"Document keys can be provided by the user upon document creation, or a unique value is assigned automatically. It can not be changed later. All three system attributes starting with an underscore `_` are read-only."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "b9WJ-CDrd50q"
},
"source": [
"Next, let us add some more characters. The `LET` keyword defines a variable with name data and an array of objects as value, so `LET variableName = valueExpression` and the expression being a literal array definition like `[ {...}, {...}, ... ]`.\n",
"\n",
"`FOR variableName IN expression` is used to iterate over each element of the data array. In each loop, one element is assigned to the variable `d`. This variable is then used in the `INSERT` statement instead of a literal object definition. What is does is basically:"
]
},
{
"cell_type": "code",
"execution_count": 11,
@@ -409,15 +388,6 @@
"aql.execute(insert_query)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "7yaBXHLPd50r"
},
"source": [
"As before let us check the `Characters` collection, but this time only return each characters name:"
]
},
{
"cell_type": "code",
"execution_count": 20,
@@ -759,15 +729,6 @@
" print(doc)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "XRHqd22qd50v"
},
"source": [
"Note, that here we customized the `RETURN` to return a json document consisting of name and season."
]
},
{
"cell_type": "markdown",
"metadata": {
@@ -1403,15 +1364,6 @@
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "L2moBhHpd50w"
},
"source": [
"* https://www.arangodb.com/docs/stable/aql/tutorial.html"
]
},
{
"cell_type": "code",
"source": [
@@ -1530,6 +1482,15 @@
]
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "L2moBhHpd50w"
},
"source": [
"* https://www.arangodb.com/docs/stable/aql/tutorial.html"
]
}
],
"metadata": {

0 comments on commit 328ec5c

Please sign in to comment.