arangorb 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 94ef7f7791231240e7704e15356d273d7401d349
4
+ data.tar.gz: 7741451323fb5e6e5162b408a9b3b4300e1a5fbc
5
+ SHA512:
6
+ metadata.gz: 83a513658f5e8cf0c883860f6f2fd205d40572c55a2311cc49464f794dc4067894c9ad4feda7a9a55fb7e4f522a2765b6aba18c48b7726743fd72af33b16af4b
7
+ data.tar.gz: fe0a6c1e2f8c03e751f9b55abd882204a1e541eef4291df94fa18c3a74e72f495f3b1a374977bd041c2cc465526933834c93efd5360ba53c30caab751ca99281
data/ArangoRB.gemspec ADDED
@@ -0,0 +1,18 @@
1
+ # lib = File.expand_path('../lib', __FILE__)
2
+ # $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "rake"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'arangorb'
7
+ s.version = '0.1.0'
8
+ s.authors = ['Stefano Martin']
9
+ s.email = ['stefano@seluxit.com']
10
+ s.homepage = 'https://github.com/StefanoMartin/ArangoRB'
11
+ s.license = 'MIT'
12
+ s.summary = 'A simple ruby client for ArangoDB'
13
+ s.description = 'ArangoDB is a powerful mixed database based on documents and graphs, with an interesting language called AQl. ArangoRB is a Ruby gems to use Ruby to interact with its HTTP API.'
14
+ s.platform = Gem::Platform::RUBY
15
+ s.require_paths = ['lib']
16
+ s.files = FileList['lib/*', 'spec/**/*', 'ArangoRB.gemspec', 'Gemfile', 'LICENSE', 'README.md'].to_a
17
+ s.add_dependency 'httparty', '~> 0.14', '>= 0.14.0'
18
+ end
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "httparty", "~>0.14.0"
4
+
5
+ group :development, :test do
6
+ gem "rspec", "~>3.5"
7
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 StefanoMartin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,501 @@
1
+ ArangoRB
2
+ ===============================
3
+
4
+ [ArangoDB](https://www.arangodb.com/) is a native multi-model database with flexible data models for document, graphs, and key-values.
5
+ ArangoRB would like to be a Ruby Gem to use ArangoDB with Ruby. ArangoRB is based on the [HTTP API of ArangoDB](https://docs.arangodb.com/3.0/HTTP/index.html).
6
+
7
+ ArangoRB has been tested with ArangoDB 3.0 on Ruby 2.3.1. It requires the gem "HTTParty"
8
+
9
+ At the moment ArangoRB is not a Gem: to install it clone the project, create a link in your project and then use
10
+ `require_relative "./ArangoRB/ArangoRB"` in your ruby code.
11
+
12
+ When it will be a gem you can use `require "arangorb"`.
13
+
14
+ ## Classes used
15
+
16
+ ArangoRB has the following classes.
17
+
18
+ * [ArangoS](#arangos): to manage the global variables for the management of the database
19
+ * [ArangoDB](#arangodb): to manage a Database
20
+ * [ArangoC](#arangoc): to manage a Collection
21
+ * [ArangoDoc](#arangodoc): to manage a Document
22
+ * [ArangoV](#arangov): to manage a Vertex
23
+ * [ArangoE](#arangoe): to manage an Edge
24
+ * [ArangoG](#arangog): to manage a Graph
25
+ * [ArangoT](#arangot): to manage a Traverse operation
26
+ * [ArangoAQL](#arangoaql): to manage an AQL instance
27
+
28
+ <a name="arangos"></a>
29
+ ## ArangoS - ArangoDB Server
30
+
31
+ ArangoS is used to manage global variables for the management of the database and it is the mandatory step to start your database.
32
+
33
+ To setup your server use:
34
+
35
+ ``` ruby
36
+ ArangoS.default_server user: "Username", password: "MyPass", server: "localhost", port: "8529"
37
+ ```
38
+
39
+ Default value for the server are user: "root", server: "localhost", port: "8529". Password must be defined.
40
+
41
+ ### Global variables
42
+
43
+ The databases, graphs and collections used in your program can be defined every time. But often the user needs to use only a single database, a single graph and a single collection.
44
+ If this is the case, the user can use ArangoS to define this value once for all the ArangoRB instances.
45
+
46
+ ``` ruby
47
+ ArangoS.database = "MyDatabase"
48
+ ArangoS.graph = "MyGraph"
49
+ ArangoS.collection = "MyCollection"
50
+ ```
51
+
52
+ By default the global database is "\_system".
53
+
54
+ ### Verbose
55
+
56
+ For Debugging reasons the user sometimes would like to receive the original JSON file from the database. To do this you can use the verbose command.
57
+
58
+ ``` ruby
59
+ ArangoS.verbose = true
60
+ ```
61
+
62
+ Remember that verbose is only for testing reason: to work efficiently verbose should be false.
63
+
64
+ <a name="arangodb"></a>
65
+ ## ArangoDB - ArangoDB Database
66
+
67
+ ArangoDB is used to manage your Database. You can create an instance in the following way:
68
+
69
+ ``` ruby
70
+ myDatabase = ArangoDB.new(database: "MyDatabase")
71
+ ```
72
+
73
+ Alternatively, you can use ArangoS:
74
+
75
+ ``` ruby
76
+ ArangoS.database = "MyDatabase"
77
+ myDatabase = ArangoDB.new
78
+ ```
79
+
80
+ ### Create and Destroy a Database
81
+
82
+ ``` ruby
83
+ myDatabase.create
84
+ mmyDatabase.destroy
85
+ ```
86
+
87
+ ### Retrieve information
88
+
89
+ ``` ruby
90
+ ArangoDB.info # Obtain general info about the databases
91
+ ArangoDB.databases # Obtain an Array with the available databases
92
+ myDatabase.collections # Obtain an Array with the available collections in the selected Database
93
+ myDatabase.graphs # Obtain an Array with the available graphs in the selected Database
94
+ ```
95
+
96
+ ### Query
97
+
98
+ ``` ruby
99
+ myDatabase.propertiesQuery; # See property of the Query
100
+ myDatabase.currentQuery; # Check the current Query
101
+ myDatabase.slowQuery; # Find slow queries
102
+ myDatabase.stopSlowQuery; # Stop slow queries
103
+ myDatabase.kill id: myQuery.id # Kill a Query
104
+ myDatabase.changePropertiesQuery maxSlowQueries: 65 # Change properties of a Query
105
+ ```
106
+
107
+ ### Cache
108
+
109
+ ``` ruby
110
+ myDatabase.clearCache # Clear Cache
111
+ myDatabase.propertyCache # Check properties Cache
112
+ myDatabase.changePropertyCache maxResults: 30 # Change properties Cache
113
+ ```
114
+
115
+ ### AQL Functions
116
+
117
+ ``` ruby
118
+ myDatabase.createFunction code: "function(){return 1+1;}", name: "myFunction" # Create a new Function
119
+ myDatabase.deleteFunction name: "myFunction" # Delete a function
120
+ myDatabase.functions # Retrieve a list of the available functions
121
+ ```
122
+ <a name="arangoc"></a>
123
+ ## ArangoC - ArangoDB Collection
124
+
125
+ ArangoDB is used to manage your Collections. You can create an ArangoC instance in one of the following way:
126
+
127
+ ``` ruby
128
+ myCollection = ArangoC.new(database: "MyDatabase", collection: "MyCollection")
129
+ myCollection = ArangoC.new(collection: "MyCollection") # If the database has been already defined with ArangoS
130
+ myCollection = ArangoC.new # If the database and the collection have been already defined with ArangoS
131
+ ```
132
+
133
+ A Collection can be of two types: "Document" and "Edge". If you want to specify it, uses:
134
+
135
+ ``` ruby
136
+ myCollectionA = ArangoC.new collection: "MyCollectionA", type: "Document"
137
+ myCollectionB = ArangoC.new collection: "MyCollectionB", type: "Edge"
138
+ ```
139
+
140
+ ### Create a Collection
141
+
142
+ `myCollection.create`
143
+
144
+ If not specified the default type of the Collection is "Document".
145
+ To create an Edge Collection you can use one of the next three options:
146
+
147
+ ``` ruby
148
+ myCollection.create_edge_collection
149
+ myCollection.create type: 3
150
+ myCollectionB = ArangoC.new(collection: "MyCollectionB", type: "Edge"); myCollectionB.create
151
+ ```
152
+
153
+ ### Destroy or Truncate a Collections
154
+
155
+ Destroy will delete from the Database the selected Collection.
156
+
157
+ `myCollection.destroy`
158
+
159
+ Truncate will delete all the Documents inside the selected Collection.
160
+
161
+ `myCollection.truncate`
162
+
163
+ ### Retrieve information
164
+
165
+ ``` ruby
166
+ myCollection.retrieve # Retrieve the selected Collection
167
+ myCollection.properties # Properties of the Collection
168
+ myCollection.count # Number of Documents in the Collection
169
+ myCollection.stats # Statistics of the Collection
170
+ myCollection.checksum
171
+ ```
172
+
173
+ To retrieve the documents of a Collection you can use:
174
+
175
+ ``` ruby
176
+ myCollection.documents
177
+ myCollection.allDocuments
178
+ ```
179
+
180
+ These two functions are similar except for the fact that you can assign different variables.
181
+
182
+ `myCollection.documents type: "path"`
183
+
184
+ Type can be "path", "id" or "key" in relation what we wish to have. If not specified we will receive an array of ArangoDoc instances.
185
+
186
+ `myCollection.allDocuments skip: 3, limit: 100, batchSize: 10`
187
+
188
+ It means that we skip the first three Documents, we can retrieve the next 100 Documents but we return only the first ten.
189
+
190
+ To retrieve specific Document you can use:
191
+
192
+ ``` ruby
193
+ myCollection.documentsMatch match: {"value" => 4} # All Documents of the Collection with value equal to 4
194
+ myCollection.documentMatch match: {"value" => 4} # The first Document of the Collection with value equal to 4
195
+ myCollection.documentByKeys keys: ["4546", "4646"] # Documents of the Collection with the keys in the Array
196
+ myCollection.random # A random Document of the Collection
197
+ ```
198
+
199
+ ### Modify the Collection
200
+
201
+ ``` ruby
202
+ myCollection.load # Load the Collection
203
+ myCollection.unload # Unload the Collection
204
+ myCollection.change waitForSync: true # Change a property of the Collection
205
+ myCollection.rename "myCollectionC" # Rename the Collection
206
+ ```
207
+
208
+ ### Other operations
209
+
210
+ ``` ruby
211
+ myCollection.removeByKeys keys: ["4546", "4646"] # Documents of the Collection with the keys in the Array will be removed
212
+ myCollection.removeMatch match: {"value" => 4} # All Documents of the Collection with value equal to 4 will be removed
213
+ myCollection.replaceMatch match: {"value" => 4}, newValue: {"value" => 6} # All Documents of the Collection with value equal to 4 will be replaced with the new Value
214
+ myCollection.updateMatch match: {"value" => 4}, newValue: {"value" => 6} # All Documents of the Collection with value equal to 4 will be updated with the new Value
215
+ ```
216
+
217
+ <a name="arangodoc"></a>
218
+ ## ArangoDoc - ArangoDB Document
219
+
220
+ An Arango Document is an element of a Collection. Edges are documents with "\_from" and "\_to" in their body.
221
+ You can create an ArangoC instance in one of the following way:
222
+
223
+ ``` ruby
224
+ myDocument = ArangoDoc.new(database: "MyDatabase", collection: "MyCollection", key: "myKey")
225
+ myDocument = ArangoDoc.new(collection: "MyCollection", key: "myKey") # If the database has been already defined with ArangoS
226
+ myDocument = ArangoDoc.new(collection: myCollection, key: "myKey") # If the database has been already defined with ArangoS and myCollection is an ArangoC instance
227
+ myDocument = ArangoDoc.new(key: "myKey") # If the database and the collection have been already defined with ArangoS
228
+ myDocument = ArangoDoc.new # If the database and the collection have been already defined with ArangoS and I don't want to define a key for my Instance
229
+ ```
230
+
231
+ In the case you want to define a Edge, it is convenient to introduce them during the instance.
232
+
233
+ ``` ruby
234
+ myEdge = ArangoDoc.new from: myDocA, to: myDocB
235
+ ```
236
+
237
+ where myDocA and myDocB are the IDs of two Documents or are two ArangoDoc instances.
238
+
239
+ When you do the instance of an ArangoDoc is a good idea to define a Body for the Document you want:
240
+
241
+ ``` ruby
242
+ myDocument = ArangoDoc.new(body: {"value" => 17})
243
+ ```
244
+
245
+ ### Create one or more Documents
246
+
247
+ You have three way to create a single Document.
248
+
249
+ ``` ruby
250
+ myDocument.create
251
+ myCollection.create_document document: myDocument # myDocument is an ArangoDoc instance or a Hash
252
+ ArangoDoc.create(body: {"value" => 17}, collection: myDocument)
253
+ ```
254
+
255
+ You have two way to create more Documents.
256
+
257
+ ``` ruby
258
+ myCollection.create_document document: [myDocumentA, myDocumentB, {"value" => 17}] # Array of ArangoDoc instances and Hashes
259
+ ArangoDoc.create(body: [{"value" => 17}, {"value" => 18}, {"value" => 3}], collection: myDocument) # Array of only Hashes
260
+ ```
261
+
262
+ ### Create one or more Edges
263
+
264
+ We have different way to create one or multiple edges. Here some example:
265
+
266
+ ``` ruby
267
+ myEdge = ArangoDoc.new from: myDocA, to: myDocB; myEdge.create
268
+ myEdge.create_edge from: myDocA, to: myDocB # myDocA and myDocB are ArangoDoc ids or ArangoDoc instances
269
+ myEdgeCollection.create_edge document: myEdge, from: myDocA, to: myDocB
270
+ ArangoDoc.create_edge(body: {"value" => 17}, from: myDocA, to: myDocB, collection: myEdgeCollection)
271
+ ```
272
+
273
+ Further we have the possibility to create different combination of Edges in only one line of code
274
+
275
+ One-to-one with one Edge class
276
+
277
+ * [myDocA] --(myEdge)--> [myDocB]
278
+
279
+ ``` ruby
280
+ myEdgeCollection.create_edge document: myEdge, from: myDocA, to: myDocB
281
+ ```
282
+
283
+ One-to-more with one Edge class (and More-to-one with one Edge class)
284
+
285
+ * [myDocA] --(myEdge)--> [myDocB]
286
+ * [myDocA] --(myEdge)--> [myDocC]
287
+
288
+ ``` ruby
289
+ myEdgeCollection.create_edge document: myEdge, from: myDocA, to: [myDocB, myDocC]
290
+ ```
291
+
292
+ More-to-More with one Edge class
293
+
294
+ * [myDocA] --(myEdge)--> [myDocC]
295
+ * [myDocB] --(myEdge)--> [myDocC]
296
+ * [myDocA] --(myEdge)--> [myDocD]
297
+ * [myDocB] --(myEdge)--> [myDocD]
298
+
299
+ ``` ruby
300
+ myEdgeCollection.create_edge document: myEdge, from: [myDocA, myDocB], to: [myDocC, myDocD]
301
+ ```
302
+
303
+ More-to-More with more Edge classes
304
+
305
+ * [myDocA] --(myEdge)--> [myDocC]
306
+ * [myDocB] --(myEdge)--> [myDocC]
307
+ * [myDocA] --(myEdge)--> [myDocD]
308
+ * [myDocB] --(myEdge)--> [myDocD]
309
+ * [myDocA] --(myEdge2)--> [myDocC]
310
+ * [myDocB] --(myEdge2)--> [myDocC]
311
+ * [myDocA] --(myEdge2)--> [myDocD]
312
+ * [myDocB] --(myEdge2)--> [myDocD]
313
+
314
+ ``` ruby
315
+ myEdgeCollection.create_edge document: [myEdge, myEdge2], from: [myDocA, myDocB], to: [myDocC, myDocD]
316
+ ```
317
+
318
+ ### Destroy a Document
319
+
320
+ ``` ruby
321
+ myDocument.destroy
322
+ ```
323
+
324
+ ### Retrieve information
325
+
326
+ ``` ruby
327
+ myDocument.retrieve # Retrieve Document
328
+ myDocument.retrieve_edges(collection: myEdgeCollection) # Retrieve all myEdgeCollection edges connected with the Document
329
+ myDocument.any(myEdgeCollection) # Retrieve all myEdgeCollection edges connected with the Document
330
+ myDocument.in(myEdgeCollection) # Retrieve all myEdgeCollection edges coming in the Document
331
+ myDocument.out(myEdgeCollection) # Retrieve all myEdgeCollection edges going out the Document
332
+ myEdge.from # Retrieve the document at the begin of the edge
333
+ myEdge.to # Retrieve the document at the end of the edge
334
+ ```
335
+
336
+ #### Example: how to navigate the edges
337
+
338
+ Think for example that we have the following schema:
339
+ * A --[class: a, name: aa]--> B
340
+ * A --[class: a, name: bb]--> C
341
+ * A --[class: b, name: cc]--> D
342
+ * B --[class: a, name: dd]--> E
343
+
344
+ Then we have:
345
+
346
+ * A.retrieve is A
347
+ * A.retrieve_edges(collection: a) is [aa, bb]
348
+ * B.any(a) is [aa, dd]
349
+ * B.in(a) is [aa]
350
+ * B.out(a) is [dd]
351
+ * aa.from is A
352
+ * aa.to is B
353
+
354
+ We can even do some combinations: for example A.out(a)[0].to.out(a)[0].to is E since:
355
+ * A.out(a) is [aa]
356
+ * A.out(a)[0] is aa
357
+ * A.out(a)[0].to is B
358
+ * A.out(a)[0].to.out(a) is [dd]
359
+ * A.out(a)[0].to.out(a)[0] is dd
360
+ * A.out(a)[0].to.out(a)[0].to is E
361
+
362
+ ### Modify
363
+
364
+ ``` ruby
365
+ myDocument.update body: {"value" => 3} # We update or add a value
366
+ myDocument.replace body: {"value" => 3} # We replace a value
367
+ ```
368
+
369
+ <a name="arangog"></a>
370
+ ## ArangoG - ArangoDB Graph
371
+
372
+ ArangoG are used to manage graphs. You can create an ArangoG instance in one of the following way:
373
+
374
+ ``` ruby
375
+ myGraph = ArangoG.new(database: "MyDatabase", graph: "MyGraph")
376
+ myGraph = ArangoG.new(graph: "MyGraph") # If the database has been already defined with ArangoS
377
+ myGraph = ArangoG.new # If the database and the graph have been already defined with ArangoS
378
+ ```
379
+
380
+ ### Create, Retrieve and Destroy a Graph
381
+
382
+ ``` ruby
383
+ myGraph.create # create a new Graph
384
+ myGraph.retrieve # retrieve the Graph
385
+ myGraph.destroy # destroy the Graph
386
+ ```
387
+
388
+ ### Manage Vertex Collections
389
+
390
+ ``` ruby
391
+ myGraph.vertexCollections # Retrieve all the vertexCollections of the Graph
392
+ myGraph.addVertexCollection(collection: "myCollection") # Add a Vertex Collection to our Graph
393
+ myGraph.removeVertexCollection(collection: "myCollection") # Remove a Vertex Collection to our Graph
394
+ ```
395
+
396
+ ### Manage Edge Collections
397
+
398
+ ``` ruby
399
+ myGraph.edgeCollections # Retrieve all the edgeCollections of the Graph
400
+ myGraph.addEdgeCollections(collection: "myEdgeCollection", from: "myCollectionA", to: "myCollectionB") # Add an Edge Collection to our Graph
401
+ myGraph.replaceEdgeCollections(collection: "myEdgeCollection", from: "myCollectionA", to: "myCollectionB") # Replace an Edge Collection to our Graph
402
+ myGraph.removeEdgeCollections(collection: "myEdgeCollection") # Remove an Edge Collection to our Graph
403
+ ```
404
+
405
+ <a name="arangov"></a><a name="arangoe"></a>
406
+ ## ArangoV - ArangoDB Vertex and ArangoE - ArangoDB Edge
407
+
408
+ Both these two classes inherit the class ArangoDoc.
409
+ These two classes have been created since ArangoDB offers, in connection of the chosen graph, other possible HTTP requests to fetch Vertexes and Edges. We recommend the reader to read carefully the section on ArangoDoc instances before to use ArangoV and ArangoE instances.
410
+
411
+ ### ArangoV methods
412
+
413
+ ArangoV inherit all the methods of ArangoDoc class. The following one works similar to the one of ArangoDoc Class but use a different HTTP request. For this reason the performance could be different.
414
+ To use ArangoV, the Collection of the Vertex needs to be added to the VertexCollections of the chosen Graph.
415
+
416
+ ``` ruby
417
+ myVertex = ArangoV.new key: "newVertex", body: {"value" => 3}, collection: "myCollection", graph: "myGraph", database: "myDatabase"
418
+ myVertex.create # create a new Document in the Graph
419
+ myVertex.retrieve # retrieve a Document
420
+ myVertex.replace body: {"value" => 6} # replace the Document
421
+ myVertex.update body: {"value" => 6} # update the Document
422
+ myVertex.destroy # delete the Document
423
+ ```
424
+
425
+ ### ArangoE methods
426
+
427
+ ArangoE inherit all the methods of ArangoDoc class. The following one works similar to the one of ArangoDoc Class but use a different HTTP request. For this reason the performance could be different.
428
+ To use ArangoE, the Collection of the Edge needs to be added to the EdgeCollections of the chosen Graph.
429
+
430
+ ``` ruby
431
+ myEdge = ArangoE.new key: "newVertex", body: {"value" => 3}, from: myArangoDoc, to: myArangoDoc, collection: "myCollection", graph: "myGraph", database: "myDatabase"
432
+ myEdge.create # create a new Document of type Edge in the Graph
433
+ myEdge.retrieve # retrieve a Document
434
+ myEdge.replace body: {"value" => 6} # replace the Document
435
+ myEdge.update body: {"value" => 6} # update the Document
436
+ myEdge.destroy # delete the Document
437
+ ```
438
+
439
+ <a name="arangot"></a>
440
+ ## ArangoT - ArangoDB Transaction
441
+
442
+ ArangoT is used to administrate the transaction.
443
+ ArangoT needs to know the vertex from where the transaction starts, the direction the transaction is going and either the Graph or the EdgeCollection we want to analize.
444
+
445
+ ``` ruby
446
+ myTransaction = ArangoT.new # create new ArangoTransaction
447
+ myTransaction.vertex = myVertex # define starting Vertex
448
+ myTransaction.graph = myGraph # define used Graph
449
+ myTransaction.edgeCollection = myEdgeCollection # define used Edge
450
+ myTransaction.in # Direction is in
451
+ myTransaction.out # Direction is out
452
+ myTransaction.any # Direction is in and out
453
+ myTransaction.min = 1 # Define how minimum deep we want to go with the transaction
454
+ myTransaction.max = 3 # Define how maximum deep we want to go with the transaction
455
+ ```
456
+
457
+ After the transaction is setup, you can execute it:
458
+
459
+ ``` ruby
460
+ myTransaction.execute
461
+ ```
462
+
463
+ <a name="arangoaql"></a>
464
+ ## ArangoAQL - ArangoDB Query Language
465
+
466
+ ArangoAQL is used to manage the ArangoDB query languages. To instantiate a query use:
467
+
468
+ ``` ruby
469
+ myQuery = ArangoAQL.new(query: "FOR v,e,p IN 1..6 ANY 'Year/2016' GRAPH 'MyGraph' FILTER p.vertices[1].num == 6 && p.vertices[2].num == 22 && p.vertices[6]._key == '424028e5-e429-4885-b50b-007867208c71' RETURN [p.vertices[4].value, p.vertices[5].data]")
470
+ ```
471
+
472
+ To execute it use:
473
+ ``` ruby
474
+ myQuery.execute
475
+ ```
476
+
477
+ If the query is too big, you can divide the fetching in piece, for example:
478
+ ``` ruby
479
+ myQuery.size = 10
480
+ myQuery.execute # First 10 documents
481
+ myQuery.next # Next 10 documents
482
+ myQuery.next # Next 10 documents
483
+ ```
484
+
485
+ ### Check property query
486
+
487
+ ``` ruby
488
+ myQuery.explain # Show data query
489
+ myQuery.parse # Parse query
490
+ myQuery.properties; # Check properties
491
+ myQuery.current; # Retrieve current Query
492
+ myQuery.slow; # Retrieve slow Queries
493
+ myQuery.changeProperties maxSlowQueries: 65 # Change Properties
494
+ ```
495
+
496
+ ### Delete query
497
+
498
+ ``` ruby
499
+ myQuery.stopSlow; # Stop Slow query
500
+ myQuery.kill; # Kill Query
501
+ ```