diff --git a/Documentation/Books/Drivers/GO/ConnectionManagement/README.md b/Documentation/Books/Drivers/GO/ConnectionManagement/README.md index 08b2dd150c..67de1a7218 100644 --- a/Documentation/Books/Drivers/GO/ConnectionManagement/README.md +++ b/Documentation/Books/Drivers/GO/ConnectionManagement/README.md @@ -1,4 +1,4 @@ - + # ArangoDB GO Driver - Connection Management ## Failover diff --git a/Documentation/Books/Drivers/GO/ExampleRequests/README.md b/Documentation/Books/Drivers/GO/ExampleRequests/README.md index 632bfc8dbf..9bc9909658 100644 --- a/Documentation/Books/Drivers/GO/ExampleRequests/README.md +++ b/Documentation/Books/Drivers/GO/ExampleRequests/README.md @@ -1,4 +1,4 @@ - + # ArangoDB GO Driver - Example requests ## Connecting to ArangoDB diff --git a/Documentation/Books/Drivers/GO/GettingStarted/README.md b/Documentation/Books/Drivers/GO/GettingStarted/README.md index c9637deb97..cfc6ec990d 100644 --- a/Documentation/Books/Drivers/GO/GettingStarted/README.md +++ b/Documentation/Books/Drivers/GO/GettingStarted/README.md @@ -1,4 +1,4 @@ - + # ArangoDB GO Driver - Getting Started ## Supported versions diff --git a/Documentation/Books/Drivers/GO/README.md b/Documentation/Books/Drivers/GO/README.md index 178c78f01c..4701bd6c6e 100644 --- a/Documentation/Books/Drivers/GO/README.md +++ b/Documentation/Books/Drivers/GO/README.md @@ -1,4 +1,4 @@ - + # ArangoDB GO Driver The official [ArangoDB](https://arangodb.com) GO Driver diff --git a/Documentation/Books/Drivers/JS/GettingStarted/README.md b/Documentation/Books/Drivers/JS/GettingStarted/README.md index fb27cb73e9..6eedb3f88c 100644 --- a/Documentation/Books/Drivers/JS/GettingStarted/README.md +++ b/Documentation/Books/Drivers/JS/GettingStarted/README.md @@ -1,12 +1,17 @@ - + # ArangoDB JavaScript Driver - Getting Started ## Compatibility -ArangoJS is compatible with ArangoDB 3.0 and later. **For using ArangoJS with -2.8 or earlier see the upgrade note below.** ArangoJS is tested against the two -most-recent releases of ArangoDB 3 (currently 3.2 and 3.3) as well as the most -recent version of 2.8 and the latest development version. +ArangoJS is compatible with the latest stable version of ArangoDB available at +the time of the driver release. + +The [_arangoVersion_ option](../Reference/Database/README.md) +can be used to tell arangojs to target a specific +ArangoDB version. Depending on the version this will enable or disable certain +methods and change behavior to maintain compatibility with the given version. +The oldest version of ArangoDB supported by arangojs when using this option +is 2.8.0 (using `arangoVersion: 20800`). The yarn/npm distribution of ArangoJS is compatible with Node.js versions 9.x (latest), 8.x (LTS) and 6.x (LTS). Node.js version support follows @@ -17,16 +22,10 @@ versions of all modern browsers (Edge, Chrome, Firefox and Safari). Versions outside this range may be compatible but are not actively supported. -**Upgrade note**: If you want to use arangojs with ArangoDB 2.8 or earlier -remember to set the appropriate `arangoVersion` option (e.g. `20800` for version -2.8.0). The current default value is `30000` (indicating compatibility with -version 3.0.0 and newer). **The driver will behave differently depending on this -value when using APIs that have changed between these versions.** - -**Upgrade note for 6.0.0**: All asynchronous functions now return promises and -support for node-style callbacks has been removed. If you are using a version of -Node.js older than Node.js 6.x LTS ("Boron") make sure you replace the native -`Promise` implementation with a substitute like [bluebird](https://github.com/petkaantonov/bluebird) +**Note**: Starting with arangojs 6.0.0, all asynchronous functions return +promises. If you are using a version of Node.js older than Node.js 6.x LTS +("Boron") make sure you replace the native `Promise` implementation with a +substitute like [bluebird](https://github.com/petkaantonov/bluebird) to avoid a known memory leak in older versions of the V8 JavaScript engine. ## Versions @@ -35,11 +34,11 @@ The version number of this driver does not indicate supported ArangoDB versions! This driver uses semantic versioning: -* A change in the bugfix version (e.g. X.Y.0 -> X.Y.1) indicates internal +- A change in the bugfix version (e.g. X.Y.0 -> X.Y.1) indicates internal changes and should always be safe to upgrade. -* A change in the minor version (e.g. X.1.Z -> X.2.0) indicates additions and +- A change in the minor version (e.g. X.1.Z -> X.2.0) indicates additions and backwards-compatible changes that should not affect your code. -* A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_ +- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_ changes that require changes in your code to upgrade. If you are getting weird errors or functions seem to be missing, make sure you @@ -59,27 +58,6 @@ You can find the documentation for each version by clicking on the corresponding date on the left in [the list of version tags](https://github.com/arangodb/arangojs/tags). -## Testing - -Run the tests using the `yarn test` or `npm test` commands: - -```sh -yarn test -# - or - -npm test -``` - -By default the tests will be run against a server listening on -`http://localhost:8529` (using username `root` with no password). To -override this, you can set the environment variable `TEST_ARANGODB_URL` to -something different: - -```sh -TEST_ARANGODB_URL=http://myserver.local:8530 yarn test -# - or - -TEST_ARANGODB_URL=http://myserver.local:8530 npm test -``` - ## Install ### With Yarn or NPM @@ -171,11 +149,10 @@ const db = new Database(); var arangojs = require("arangojs"); var db = new arangojs.Database(); var now = Date.now(); -db - .query({ - query: "RETURN @value", - bindVars: { value: now } - }) +db.query({ + query: "RETURN @value", + bindVars: { value: now } +}) .then(function(cursor) { return cursor.next().then(function(result) { // ... @@ -213,7 +190,9 @@ AQL queries without making your code vulnerable to injection attacks. ## Error responses If arangojs encounters an API error, it will throw an _ArangoError_ with an -[_errorNum_ as defined in the ArangoDB documentation](../../..//Manual/Appendix/ErrorCodes.html) as well as a _code_ and _statusCode_ property indicating the intended and actual HTTP status code of the response. +[_errorNum_ error code](../../..//Manual/Appendix/ErrorCodes.html) +as well as a _code_ and _statusCode_ property indicating the intended and +actual HTTP status code of the response. For any other error responses (4xx/5xx status code), it will throw an _HttpError_ error with the status code indicated by the _code_ and _statusCode_ properties. @@ -224,22 +203,22 @@ not be parsed, a _SyntaxError_ may be thrown instead. In all of these cases the error object will additionally have a _response_ property containing the server response object. -If the request failed at a network level or the connection was closed without receiving a response, the underlying error will be thrown instead. +If the request failed at a network level or the connection was closed without +receiving a response, the underlying error will be thrown instead. **Examples** ```js // Using async/await try { - const info = await db.createDatabase('mydb'); + const info = await db.createDatabase("mydb"); // database created } catch (err) { console.error(err.stack); } // Using promises with arrow functions -db.createDatabase('mydb') -.then( +db.createDatabase("mydb").then( info => { // database created }, @@ -247,7 +226,9 @@ db.createDatabase('mydb') ); ``` -**Note**: the examples in the remainder of this documentation use async/await +{% hint 'tip' %} +The examples in the remainder of this documentation use `async`/`await` and other modern language features like multi-line strings and template tags. When developing for an environment without support for these language features, -just use promises instead as in the above example. +substitute promises for `await` syntax as in the above example. +{% endhint %} diff --git a/Documentation/Books/Drivers/JS/README.md b/Documentation/Books/Drivers/JS/README.md index 1c918eb604..c4f95ae9c3 100644 --- a/Documentation/Books/Drivers/JS/README.md +++ b/Documentation/Books/Drivers/JS/README.md @@ -1,4 +1,4 @@ - + # ArangoDB JavaScript Driver The official ArangoDB low-level JavaScript client. @@ -11,6 +11,6 @@ instead; specifically the `db` object exported by the `@arangodb` module. The JavaScript driver is **only** meant to be used when accessing ArangoDB from **outside** the database. -* [Getting Started](GettingStarted/README.md) -* [Reference](Reference/README.md) -* [Changelog](https://github.com/arangodb/arangojs/blob/master/CHANGELOG.md#readme) +- [Getting Started](GettingStarted/README.md) +- [Reference](Reference/README.md) +- [Changelog](https://github.com/arangodb/arangojs/blob/master/CHANGELOG.md#readme) diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/BulkImport.md b/Documentation/Books/Drivers/JS/Reference/Collection/BulkImport.md index 7a2cdd8ce6..70aafed31c 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/BulkImport.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/BulkImport.md @@ -1,4 +1,4 @@ - + # Bulk importing documents This function implements the @@ -12,90 +12,140 @@ Bulk imports the given _data_ into the collection. **Arguments** -* **data**: `Array> | Array` +- **data**: `Array | Buffer | string` - The data to import. This can be an array of documents: + The data to import. Depending on the _type_ option this can be any of the + following: - ```js - [ - {key1: value1, key2: value2}, // document 1 - {key1: value1, key2: value2}, // document 2 - ... - ] - ``` + For type `"documents"` or `"auto"`: - Or it can be an array of value arrays following an array of keys. + - an array of documents, e.g. - ```js - [ - ['key1', 'key2'], // key names - [value1, value2], // document 1 - [value1, value2], // document 2 - ... - ] - ``` + ```json + [ + { "_key": "banana", "color": "yellow" }, + { "_key": "peach", "color": "pink" } + ] + ``` -* **opts**: `Object` (optional) If _opts_ is set, it must be an object with any + - a string or buffer containing one JSON document per line, e.g. + + ``` + {"_key":"banana","color":"yellow"} + {"_key":"peach","color":"pink"} + ``` + + For type `"array"` or `"auto"`: + + - a string or buffer containing a JSON array of documents, e.g. + + ```json + [ + { "_key": "banana", "color": "yellow" }, + { "_key": "peach", "color": "pink" } + ] + ``` + + For type `null`: + + - an array containing an array of keys followed by arrays of values, e.g. + + ``` + [ + ["_key", "color"], + ["banana", "yellow"], + ["peach", "pink"] + ] + ``` + + - a string or buffer containing a JSON array of keys followed by + one JSON array of values per line, e.g. + + ``` + ["_key", "color"] + ["banana", "yellow"] + ["peach", "pink"] + ``` + +- **opts**: `Object` (optional) If _opts_ is set, it must be an object with any of the following properties: - * **waitForSync**: `boolean` (Default: `false`) + - **type**: `string | null` (Default: `"auto"`) + + Indicates which format the data uses. + Can be `"documents"`, `"array"` or `"auto"`. + Use `null` to explicitly set no type. + + - **fromPrefix**: `string` (optional) + + Prefix to prepend to `_from` attributes. + + - **toPrefix**: `string` (optional) + + Prefix to prepend to `_to` attributes. + + - **overwrite**: `boolean` (Default: `false`) + + If set to `true`, the collection is truncated before the data is imported. + + - **waitForSync**: `boolean` (Default: `false`) Wait until the documents have been synced to disk. - * **details**: `boolean` (Default: `false`) + - **onDuplicate**: `string` (Default: `"error"`) + + Controls behavior when a unique constraint is violated. + Can be `"error"`, `"update"`, `"replace"` or `"ignore"`. + + - **complete**: `boolean` (Default: `false`) + + If set to `true`, the import will abort if any error occurs. + + - **details**: `boolean` (Default: `false`) Whether the response should contain additional details about documents that - could not be imported.false\*. + could not be imported. - * **type**: `string` (Default: `"auto"`) - - Indicates which format the data uses. Can be `"documents"`, `"array"` or - `"auto"`. - -If _data_ is a JavaScript array, it will be transmitted as a line-delimited JSON -stream. If _opts.type_ is set to `"array"`, it will be transmitted as regular -JSON instead. If _data_ is a string, it will be transmitted as it is without any -processing. - -For more information on the _opts_ object, see -[the HTTP API documentation for bulk imports](../../../..//HTTP/BulkImports/ImportingSelfContained.html). +For more information on the _opts_ object, see the +[HTTP API documentation for bulk imports](../../../..//HTTP/BulkImports/index.html). **Examples** ```js const db = new Database(); -const collection = db.collection('users'); +const collection = db.collection("users"); -// document stream -const result = await collection.import([ - {username: 'admin', password: 'hunter2'}, - {username: 'jcd', password: 'bionicman'}, - {username: 'jreyes', password: 'amigo'}, - {username: 'ghermann', password: 'zeitgeist'} -]); -assert.equal(result.created, 4); +const result = await collection.import( + [ + { username: "jcd", password: "bionicman" }, + { username: "jreyes", password: "amigo" }, + { username: "ghermann", password: "zeitgeist" } + ], + { type: "documents" } // optional +); // -- or -- -// array stream with header -const result = await collection.import([ - ['username', 'password'], // keys - ['admin', 'hunter2'], // row 1 - ['jcd', 'bionicman'], // row 2 - ['jreyes', 'amigo'], - ['ghermann', 'zeitgeist'] -]); -assert.equal(result.created, 4); +const buf = fs.readFileSync("dx_users.json"); +// [ +// {"username": "jcd", "password": "bionicman"}, +// {"username": "jreyes", "password": "amigo"}, +// {"username": "ghermann", "password": "zeitgeist"} +// ] +const result = await collection.import( + buf, + { type: "array" } // optional +); // -- or -- -// raw line-delimited JSON array stream with header -const result = await collection.import([ - '["username", "password"]', - '["admin", "hunter2"]', - '["jcd", "bionicman"]', - '["jreyes", "amigo"]', - '["ghermann", "zeitgeist"]' -].join('\r\n') + '\r\n'); -assert.equal(result.created, 4); +const result = await collection.import( + [ + ["username", "password"], + ["jcd", "bionicman"], + ["jreyes", "amigo"], + ["ghermann", "zeitgeist"] + ], + { type: null } // required +); ``` diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/CollectionManipulation.md b/Documentation/Books/Drivers/JS/Reference/Collection/CollectionManipulation.md index ff44bced0c..f06c6a15a9 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/CollectionManipulation.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/CollectionManipulation.md @@ -1,8 +1,8 @@ - + # Manipulating the collection -These functions implement -[the HTTP API for modifying collections](../../../..//HTTP/Collection/Modifying.html). +These functions implement the +[HTTP API for modifying collections](../../../..//HTTP/Collection/Modifying.html). ## collection.create @@ -15,8 +15,8 @@ then returns the server response. - **properties**: `Object` (optional) - For more information on the _properties_ object, see - [the HTTP API documentation for creating collections](../../../..//HTTP/Collection/Creating.html). + For more information on the _properties_ object, see the + [HTTP API documentation for creating collections](../../../..//HTTP/Collection/Creating.html). **Examples** @@ -82,8 +82,8 @@ Replaces the properties of the collection. - **properties**: `Object` - For information on the _properties_ argument see - [the HTTP API for modifying collections](../../../..//HTTP/Collection/Modifying.html). + For information on the _properties_ argument see the + [HTTP API for modifying collections](../../../..//HTTP/Collection/Modifying.html). **Examples** @@ -162,9 +162,10 @@ Deletes the collection from the database. This parameter must be set to `true` when dropping a system collection. - For more information on the _properties_ object, see - [the HTTP API documentation for dropping collections](../../../..//HTTP/Collection/Creating.html#drops-a-collection). - **Examples** + For more information on the _properties_ object, see the + [HTTP API documentation for dropping collections](../../../..//HTTP/Collection/Creating.html#drops-a-collection). + +**Examples** ```js const db = new Database(); diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/DocumentCollection.md b/Documentation/Books/Drivers/JS/Reference/Collection/DocumentCollection.md index b36068509c..713f590740 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/DocumentCollection.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/DocumentCollection.md @@ -1,4 +1,4 @@ - + # DocumentCollection API The _DocumentCollection API_ extends the @@ -131,8 +131,8 @@ the document's metadata. If a boolean is passed instead of an options object, it will be interpreted as the _returnNew_ option. -For more information on the _opts_ object, see -[the HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). +For more information on the _opts_ object, see the +[HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). **Examples** diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/DocumentManipulation.md b/Documentation/Books/Drivers/JS/Reference/Collection/DocumentManipulation.md index 2fe2e03b62..a0f5bb204b 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/DocumentManipulation.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/DocumentManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating documents These functions implement the @@ -11,56 +11,57 @@ These functions implement the Replaces the content of the document with the given _documentHandle_ with the given _newValue_ and returns an object containing the document's metadata. -**Note**: The _policy_ option is not available when using the driver with -ArangoDB 3.0 as it is redundant when specifying the _rev_ option. - **Arguments** -* **documentHandle**: `string` +- **documentHandle**: `string` The handle of the document to replace. This can either be the `_id` or the `_key` of a document in the collection, or a document (i.e. an object with an `_id` or `_key` property). -* **newValue**: `Object` +- **newValue**: `Object` The new data of the document. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) If _opts_ is set, it must be an object with any of the following properties: - * **waitForSync**: `boolean` (Default: `false`) + - **waitForSync**: `boolean` (Default: `false`) Wait until the document has been synced to disk. Default: `false`. - * **rev**: `string` (optional) + - **rev**: `string` (optional) Only replace the document if it matches this revision. - * **policy**: `string` (optional) + - **policy**: `string` (optional) - Determines the behaviour when the revision is not matched: + {% hint 'warning' %} + This option has no effect in ArangoDB 3.0 and later. + {% endhint %} - * if _policy_ is set to `"last"`, the document will be replaced regardless + Determines the behavior when the revision is not matched: + + - if _policy_ is set to `"last"`, the document will be replaced regardless of the revision. - * if _policy_ is set to `"error"` or not set, the replacement will fail with + - if _policy_ is set to `"error"` or not set, the replacement will fail with an error. If a string is passed instead of an options object, it will be interpreted as the _rev_ option. -For more information on the _opts_ object, see -[the HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). +For more information on the _opts_ object, see the +[HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); -const data = {number: 1, hello: 'world'}; +const collection = db.collection("some-collection"); +const data = { number: 1, hello: "world" }; const info1 = await collection.save(data); -const info2 = await collection.replace(info1, {number: 2}); +const info2 = await collection.replace(info1, { number: 2 }); assert.equal(info2._id, info1._id); assert.notEqual(info2._rev, info1._rev); const doc = await collection.document(info1); @@ -78,83 +79,84 @@ Updates (merges) the content of the document with the given _documentHandle_ with the given _newValue_ and returns an object containing the document's metadata. -**Note**: The _policy_ option is not available when using the driver with -ArangoDB 3.0 as it is redundant when specifying the _rev_ option. - **Arguments** -* **documentHandle**: `string` +- **documentHandle**: `string` Handle of the document to update. This can be either the `_id` or the `_key` of a document in the collection, or a document (i.e. an object with an `_id` or `_key` property). -* **newValue**: `Object` +- **newValue**: `Object` The new data of the document. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) If _opts_ is set, it must be an object with any of the following properties: - * **waitForSync**: `boolean` (Default: `false`) + - **waitForSync**: `boolean` (Default: `false`) Wait until document has been synced to disk. - * **keepNull**: `boolean` (Default: `true`) + - **keepNull**: `boolean` (Default: `true`) If set to `false`, properties with a value of `null` indicate that a property should be deleted. - * **mergeObjects**: `boolean` (Default: `true`) + - **mergeObjects**: `boolean` (Default: `true`) If set to `false`, object properties that already exist in the old document will be overwritten rather than merged. This does not affect arrays. - * **returnOld**: `boolean` (Default: `false`) + - **returnOld**: `boolean` (Default: `false`) If set to `true`, return additionally the complete previous revision of the changed documents under the attribute `old` in the result. - * **returnNew**: `boolean` (Default: `false`) + - **returnNew**: `boolean` (Default: `false`) If set to `true`, return additionally the complete new documents under the attribute `new` in the result. - * **ignoreRevs**: `boolean` (Default: `true`) + - **ignoreRevs**: `boolean` (Default: `true`) - 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 + 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. - * **rev**: `string` (optional) + - **rev**: `string` (optional) Only update the document if it matches this revision. - * **policy**: `string` (optional) + - **policy**: `string` (optional) - Determines the behaviour when the revision is not matched: + {% hint 'warning' %} + This option has no effect in ArangoDB 3.0 and later. + {% endhint %} - * if _policy_ is set to `"last"`, the document will be replaced regardless + Determines the behavior when the revision is not matched: + + - if _policy_ is set to `"last"`, the document will be replaced regardless of the revision. - * if _policy_ is set to `"error"` or not set, the replacement will fail with + - if _policy_ is set to `"error"` or not set, the replacement will fail with an error. If a string is passed instead of an options object, it will be interpreted as the _rev_ option. -For more information on the _opts_ object, see -[the HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). +For more information on the _opts_ object, see the +[HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); -const doc = {number: 1, hello: 'world'}; +const collection = db.collection("some-collection"); +const doc = { number: 1, hello: "world" }; const doc1 = await collection.save(doc); -const doc2 = await collection.update(doc1, {number: 2}); +const doc2 = await collection.update(doc1, { number: 2 }); assert.equal(doc2._id, doc1._id); assert.notEqual(doc2._rev, doc1._rev); const doc3 = await collection.document(doc2); @@ -171,67 +173,69 @@ assert.equal(doc3.hello, doc.hello); Updates (merges) the content of the documents with the given _documents_ and returns an array containing the documents' metadata. -**Note**: This method is new in 3.0 and is available when using the driver with -ArangoDB 3.0 and higher. +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.0 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} **Arguments** -* **documents**: `Array` +- **documents**: `Array` Documents to update. Each object must have either the `_id` or the `_key` property. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) If _opts_ is set, it must be an object with any of the following properties: - * **waitForSync**: `boolean` (Default: `false`) + - **waitForSync**: `boolean` (Default: `false`) Wait until document has been synced to disk. - * **keepNull**: `boolean` (Default: `true`) + - **keepNull**: `boolean` (Default: `true`) If set to `false`, properties with a value of `null` indicate that a property should be deleted. - * **mergeObjects**: `boolean` (Default: `true`) + - **mergeObjects**: `boolean` (Default: `true`) If set to `false`, object properties that already exist in the old document will be overwritten rather than merged. This does not affect arrays. - * **returnOld**: `boolean` (Default: `false`) + - **returnOld**: `boolean` (Default: `false`) If set to `true`, return additionally the complete previous revision of the changed documents under the attribute `old` in the result. - * **returnNew**: `boolean` (Default: `false`) + - **returnNew**: `boolean` (Default: `false`) If set to `true`, return additionally the complete new documents under the attribute `new` in the result. - * **ignoreRevs**: `boolean` (Default: `true`) + - **ignoreRevs**: `boolean` (Default: `true`) - 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 + 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. -For more information on the _opts_ object, see -[the HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). +For more information on the _opts_ object, see the +[HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); -const doc1 = {number: 1, hello: 'world1'}; +const collection = db.collection("some-collection"); +const doc1 = { number: 1, hello: "world1" }; const info1 = await collection.save(doc1); -const doc2 = {number: 2, hello: 'world2'}; +const doc2 = { number: 2, hello: "world2" }; const info2 = await collection.save(doc2); -const result = await collection.bulkUpdate([ - {_key: info1._key, number: 3}, - {_key: info2._key, number: 4} -], {returnNew: true}) +const result = await collection.bulkUpdate( + [{ _key: info1._key, number: 3 }, { _key: info2._key, number: 4 }], + { returnNew: true } +); ``` ## collection.remove @@ -240,56 +244,57 @@ const result = await collection.bulkUpdate([ Deletes the document with the given _documentHandle_ from the collection. -**Note**: The _policy_ option is not available when using the driver with -ArangoDB 3.0 as it is redundant when specifying the _rev_ option. - **Arguments** -* **documentHandle**: `string` +- **documentHandle**: `string` The handle of the document to delete. This can be either the `_id` or the `_key` of a document in the collection, or a document (i.e. an object with an `_id` or `_key` property). -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) If _opts_ is set, it must be an object with any of the following properties: - * **waitForSync**: `boolean` (Default: `false`) + - **waitForSync**: `boolean` (Default: `false`) Wait until document has been synced to disk. - * **rev**: `string` (optional) + - **rev**: `string` (optional) Only update the document if it matches this revision. - * **policy**: `string` (optional) + - **policy**: `string` (optional) - Determines the behaviour when the revision is not matched: + {% hint 'warning' %} + This option has no effect in ArangoDB 3.0 and later. + {% endhint %} - * if _policy_ is set to `"last"`, the document will be replaced regardless + Determines the behavior when the revision is not matched: + + - if _policy_ is set to `"last"`, the document will be replaced regardless of the revision. - * if _policy_ is set to `"error"` or not set, the replacement will fail with + - if _policy_ is set to `"error"` or not set, the replacement will fail with an error. If a string is passed instead of an options object, it will be interpreted as the _rev_ option. -For more information on the _opts_ object, see -[the HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). +For more information on the _opts_ object, see the +[HTTP API documentation for working with documents](../../../..//HTTP/Document/WorkingWithDocuments.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -await collection.remove('some-doc'); +await collection.remove("some-doc"); // document 'some-collection/some-doc' no longer exists // -- or -- -await collection.remove('some-collection/some-doc'); +await collection.remove("some-collection/some-doc"); // document 'some-collection/some-doc' no longer exists ``` @@ -301,13 +306,13 @@ Retrieves a list of references for all documents in the collection. **Arguments** -* **type**: `string` (Default: `"id"`) +- **type**: `string` (Default: `"id"`) The format of the document references: - * if _type_ is set to `"id"`, each reference will be the `_id` of the + - if _type_ is set to `"id"`, each reference will be the `_id` of the document. - * if _type_ is set to `"key"`, each reference will be the `_key` of the + - if _type_ is set to `"key"`, each reference will be the `_key` of the document. - * if _type_ is set to `"path"`, each reference will be the URI path of the + - if _type_ is set to `"path"`, each reference will be the URI path of the document. diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/EdgeCollection.md b/Documentation/Books/Drivers/JS/Reference/Collection/EdgeCollection.md index e64bc06259..64c23a333e 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/EdgeCollection.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/EdgeCollection.md @@ -1,4 +1,4 @@ - + # EdgeCollection API The _EdgeCollection API_ extends the @@ -79,7 +79,7 @@ if (exists === false) { ## edgeCollection.save -`async edgeCollection.save(data, [fromId, toId]): Object` +`async edgeCollection.save(data, [fromId, toId], [opts]): Object` Creates a new edge between the documents _fromId_ and _toId_ with the given _data_ and returns an object containing the edge's metadata. @@ -275,8 +275,8 @@ contained in this edge collection. - **opts**: `Object` - See - [the HTTP API documentation](../../../..//HTTP/Traversal/index.html) + See the + [HTTP API documentation](../../../..//HTTP/Traversal/index.html) for details on the additional arguments. Please note that while _opts.filter_, _opts.visitor_, _opts.init_, diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/Indexes.md b/Documentation/Books/Drivers/JS/Reference/Collection/Indexes.md index 2fd1b49cb7..9cecf6e199 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/Indexes.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/Indexes.md @@ -1,4 +1,4 @@ - + # Manipulating indexes These functions implement the @@ -12,17 +12,20 @@ Creates an arbitrary index on the collection. **Arguments** -* **details**: `Object` +- **details**: `Object` - For information on the possible properties of the _details_ object, see - [the HTTP API for manipulating indexes](../../../..//HTTP/Indexes/WorkingWith.html). + For information on the possible properties of the _details_ object, see the + [HTTP API for manipulating indexes](../../../..//HTTP/Indexes/WorkingWith.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); -const index = await collection.createIndex({type: 'hash', fields: ['a', 'a.b']}); +const collection = db.collection("some-collection"); +const index = await collection.createIndex({ + type: "hash", + fields: ["a", "a.b"] +}); // the index has been created with the handle `index.id` ``` @@ -34,34 +37,34 @@ Creates a hash index on the collection. **Arguments** -* **fields**: `Array` +- **fields**: `Array` An array of names of document fields on which to create the index. If the value is a string, it will be wrapped in an array automatically. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) Additional options for this index. If the value is a boolean, it will be interpreted as _opts.unique_. -For more information on hash indexes, see -[the HTTP API for hash indexes](../../../..//HTTP/Indexes/Hash.html). +For more information on hash indexes, see the +[HTTP API for hash indexes](../../../..//HTTP/Indexes/Hash.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -const index = await collection.createHashIndex('favorite-color'); +const index = await collection.createHashIndex("favorite-color"); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['favorite-color']); +assert.deepEqual(index.fields, ["favorite-color"]); // -- or -- -const index = await collection.createHashIndex(['favorite-color']); +const index = await collection.createHashIndex(["favorite-color"]); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['favorite-color']); +assert.deepEqual(index.fields, ["favorite-color"]); ``` ## collection.createSkipList @@ -72,34 +75,34 @@ Creates a skiplist index on the collection. **Arguments** -* **fields**: `Array` +- **fields**: `Array` An array of names of document fields on which to create the index. If the value is a string, it will be wrapped in an array automatically. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) Additional options for this index. If the value is a boolean, it will be interpreted as _opts.unique_. -For more information on skiplist indexes, see -[the HTTP API for skiplist indexes](../../../..//HTTP/Indexes/Skiplist.html). +For more information on skiplist indexes, see the +[HTTP API for skiplist indexes](../../../..//HTTP/Indexes/Skiplist.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -const index = await collection.createSkipList('favorite-color') +const index = await collection.createSkipList("favorite-color"); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['favorite-color']); +assert.deepEqual(index.fields, ["favorite-color"]); // -- or -- -const index = await collection.createSkipList(['favorite-color']) +const index = await collection.createSkipList(["favorite-color"]); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['favorite-color']); +assert.deepEqual(index.fields, ["favorite-color"]); ``` ## collection.createGeoIndex @@ -110,34 +113,34 @@ Creates a geo-spatial index on the collection. **Arguments** -* **fields**: `Array` +- **fields**: `Array` An array of names of document fields on which to create the index. Currently, geo indexes must cover exactly one field. If the value is a string, it will be wrapped in an array automatically. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) An object containing additional properties of the index. -For more information on the properties of the _opts_ object see -[the HTTP API for manipulating geo indexes](../../../..//HTTP/Indexes/Geo.html). +For more information on the properties of the _opts_ object see the +[HTTP API for manipulating geo indexes](../../../..//HTTP/Indexes/Geo.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -const index = await collection.createGeoIndex(['latitude', 'longitude']); +const index = await collection.createGeoIndex(["latitude", "longitude"]); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['longitude', 'latitude']); +assert.deepEqual(index.fields, ["longitude", "latitude"]); // -- or -- -const index = await collection.createGeoIndex('location', {geoJson: true}); +const index = await collection.createGeoIndex("location", { geoJson: true }); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['location']); +assert.deepEqual(index.fields, ["location"]); ``` ## collection.createFulltextIndex @@ -148,13 +151,13 @@ Creates a fulltext index on the collection. **Arguments** -* **fields**: `Array` +- **fields**: `Array` An array of names of document fields on which to create the index. Currently, fulltext indexes must cover exactly one field. If the value is a string, it will be wrapped in an array automatically. -* **minLength** (optional): +- **minLength** (optional): Minimum character length of words to index. Uses a server-specific default value if not specified. @@ -166,17 +169,17 @@ For more information on fulltext indexes, see ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -const index = await collection.createFulltextIndex('description'); +const index = await collection.createFulltextIndex("description"); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['description']); +assert.deepEqual(index.fields, ["description"]); // -- or -- -const index = await collection.createFulltextIndex(['description']); +const index = await collection.createFulltextIndex(["description"]); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['description']); +assert.deepEqual(index.fields, ["description"]); ``` ## collection.createPersistentIndex @@ -190,11 +193,11 @@ being that it will always be orders of magnitude slower than in-memory indexes. **Arguments** -* **fields**: `Array` +- **fields**: `Array` An array of names of document fields on which to create the index. -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) An object containing additional properties of the index. @@ -205,11 +208,11 @@ For more information on the properties of the _opts_ object see ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -const index = await collection.createPersistentIndex(['name', 'email']); +const index = await collection.createPersistentIndex(["name", "email"]); // the index has been created with the handle `index.id` -assert.deepEqual(index.fields, ['name', 'email']); +assert.deepEqual(index.fields, ["name", "email"]); ``` ## collection.index @@ -220,7 +223,7 @@ Fetches information about the index with the given _indexHandle_ and returns it. **Arguments** -* **indexHandle**: `string` +- **indexHandle**: `string` The handle of the index to look up. This can either be a fully-qualified identifier or the collection-specific key of the index. If the value is an @@ -230,15 +233,15 @@ Fetches information about the index with the given _indexHandle_ and returns it. ```js const db = new Database(); -const collection = db.collection('some-collection'); -const index = await collection.createFulltextIndex('description'); +const collection = db.collection("some-collection"); +const index = await collection.createFulltextIndex("description"); const result = await collection.index(index.id); assert.equal(result.id, index.id); // result contains the properties of the index // -- or -- -const result = await collection.index(index.id.split('/')[1]); +const result = await collection.index(index.id.split("/")[1]); assert.equal(result.id, index.id); // result contains the properties of the index ``` @@ -253,8 +256,8 @@ Fetches a list of all indexes on this collection. ```js const db = new Database(); -const collection = db.collection('some-collection'); -await collection.createFulltextIndex('description') +const collection = db.collection("some-collection"); +await collection.createFulltextIndex("description"); const indexes = await collection.indexes(); assert.equal(indexes.length, 1); // indexes contains information about the index @@ -268,7 +271,7 @@ Deletes the index with the given _indexHandle_ from the collection. **Arguments** -* **indexHandle**: `string` +- **indexHandle**: `string` The handle of the index to delete. This can either be a fully-qualified identifier or the collection-specific key of the index. If the value is an @@ -278,14 +281,14 @@ Deletes the index with the given _indexHandle_ from the collection. ```js const db = new Database(); -const collection = db.collection('some-collection'); -const index = await collection.createFulltextIndex('description'); +const collection = db.collection("some-collection"); +const index = await collection.createFulltextIndex("description"); await collection.dropIndex(index.id); // the index has been removed from the collection // -- or -- -await collection.dropIndex(index.id.split('/')[1]); +await collection.dropIndex(index.id.split("/")[1]); // the index has been removed from the collection ``` @@ -295,41 +298,43 @@ await collection.dropIndex(index.id.split('/')[1]); Creates a cap constraint index on the collection. -**Note**: This method is not available when using the driver with ArangoDB 3.0 -and higher as cap constraints are no longer supported. +{% hint 'warning' %} +This method is not available when targeting ArangoDB 3.0 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} **Arguments** -* **size**: `Object` +- **size**: `Object` An object with any of the following properties: - * **size**: `number` (optional) + - **size**: `number` (optional) The maximum number of documents in the collection. - * **byteSize**: `number` (optional) + - **byteSize**: `number` (optional) The maximum size of active document data in the collection (in bytes). If _size_ is a number, it will be interpreted as _size.size_. -For more information on the properties of the _size_ object see -[the HTTP API for creating cap constraints](https://docs.arangodb.com/2.8/HttpIndexes/Cap.html). +For more information on the properties of the _size_ object see the +[HTTP API for creating cap constraints](https://docs.arangodb.com/2.8/HttpIndexes/Cap.html). **Examples** ```js const db = new Database(); -const collection = db.collection('some-collection'); +const collection = db.collection("some-collection"); -const index = await collection.createCapConstraint(20) +const index = await collection.createCapConstraint(20); // the index has been created with the handle `index.id` assert.equal(index.size, 20); // -- or -- -const index = await collection.createCapConstraint({size: 20}) +const index = await collection.createCapConstraint({ size: 20 }); // the index has been created with the handle `index.id` assert.equal(index.size, 20); ``` diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/README.md b/Documentation/Books/Drivers/JS/Reference/Collection/README.md index cc46c224e6..930279e9b2 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/README.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/README.md @@ -1,4 +1,4 @@ - + # Collection API These functions implement the @@ -13,8 +13,8 @@ their specific type. I.e. it represents a shared subset between instances of ## Getting information about the collection -See -[the HTTP API documentation](../../../..//HTTP/Collection/Getting.html) +See the +[HTTP API documentation](../../../..//HTTP/Collection/Getting.html) for details. ## collection.exists @@ -117,8 +117,8 @@ Retrieves the collection checksum. - **opts**: `Object` (optional) - For information on the possible options see - [the HTTP API for getting collection information](../../../..//HTTP/Collection/Getting.html). + For information on the possible options see the + [HTTP API for getting collection information](../../../..//HTTP/Collection/Getting.html). **Examples** diff --git a/Documentation/Books/Drivers/JS/Reference/Collection/SimpleQueries.md b/Documentation/Books/Drivers/JS/Reference/Collection/SimpleQueries.md index 692e2cfbc5..0ebdee32d1 100644 --- a/Documentation/Books/Drivers/JS/Reference/Collection/SimpleQueries.md +++ b/Documentation/Books/Drivers/JS/Reference/Collection/SimpleQueries.md @@ -1,4 +1,4 @@ - + # Simple queries These functions implement the @@ -13,10 +13,10 @@ Performs a query to fetch all documents in the collection. Returns a **Arguments** -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) - For information on the possible options see - [the HTTP API for returning all documents](../../../..//HTTP/SimpleQuery/index.html#return-all-documents). + For information on the possible options see the + [HTTP API for returning all documents](../../../..//HTTP/SimpleQuery/index.html#return-all-documents). ## collection.any @@ -31,15 +31,17 @@ Fetches a document from the collection at random. Performs a query to fetch the first documents in the collection. Returns an array of the matching documents. -**Note**: This method is not available when using the driver with ArangoDB 3.0 -and higher as the corresponding API method has been removed. +{% hint 'warning' %} +This method is not available when targeting ArangoDB 3.0 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} **Arguments** -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) - For information on the possible options see - [the HTTP API for returning the first document of a collection](https://docs.arangodb.com/2.8/HttpSimpleQuery/#first-document-of-a-collection). + For information on the possible options see the + [HTTP API for returning the first document of a collection](https://docs.arangodb.com/2.8/HttpSimpleQuery/#first-document-of-a-collection). If _opts_ is a number it is treated as _opts.count_. @@ -50,15 +52,17 @@ and higher as the corresponding API method has been removed. Performs a query to fetch the last documents in the collection. Returns an array of the matching documents. -**Note**: This method is not available when using the driver with ArangoDB 3.0 -and higher as the corresponding API method has been removed. +{% hint 'warning' %} +This method is not available when targeting ArangoDB 3.0 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} **Arguments** -* **opts**: `Object` (optional) +- **opts**: `Object` (optional) - For information on the possible options see - [the HTTP API for returning the last document of a collection](https://docs.arangodb.com/2.8/HttpSimpleQuery/#last-document-of-a-collection). + For information on the possible options see the + [HTTP API for returning the last document of a collection](https://docs.arangodb.com/2.8/HttpSimpleQuery/#last-document-of-a-collection). If _opts_ is a number it is treated as _opts.count_. @@ -71,14 +75,14 @@ _example_. Returns a [new _Cursor_ instance](../Cursor.md) for the query results **Arguments** -* **example**: _Object_ +- **example**: _Object_ An object representing an example for documents to be matched against. -* **opts**: _Object_ (optional) +- **opts**: _Object_ (optional) - For information on the possible options see - [the HTTP API for fetching documents by example](../../../..//HTTP/SimpleQuery/index.html#find-documents-matching-an-example). + For information on the possible options see the + [HTTP API for fetching documents by example](../../../..//HTTP/SimpleQuery/index.html#find-documents-matching-an-example). ## collection.firstExample @@ -88,7 +92,7 @@ Fetches the first document in the collection matching the given _example_. **Arguments** -* **example**: _Object_ +- **example**: _Object_ An object representing an example for documents to be matched against. @@ -100,14 +104,14 @@ Removes all documents in the collection matching the given _example_. **Arguments** -* **example**: _Object_ +- **example**: _Object_ An object representing an example for documents to be matched against. -* **opts**: _Object_ (optional) +- **opts**: _Object_ (optional) - For information on the possible options see - [the HTTP API for removing documents by example](../../../..//HTTP/SimpleQuery/index.html#remove-documents-by-example). + For information on the possible options see the + [HTTP API for removing documents by example](../../../..//HTTP/SimpleQuery/index.html#remove-documents-by-example). ## collection.replaceByExample @@ -118,18 +122,18 @@ given _newValue_. **Arguments** -* **example**: _Object_ +- **example**: _Object_ An object representing an example for documents to be matched against. -* **newValue**: _Object_ +- **newValue**: _Object_ The new value to replace matching documents with. -* **opts**: _Object_ (optional) +- **opts**: _Object_ (optional) - For information on the possible options see - [the HTTP API for replacing documents by example](../../../..//HTTP/SimpleQuery/index.html#replace-documents-by-example). + For information on the possible options see the + [HTTP API for replacing documents by example](../../../..//HTTP/SimpleQuery/index.html#replace-documents-by-example). ## collection.updateByExample @@ -140,18 +144,18 @@ with the given _newValue_. **Arguments** -* **example**: _Object_ +- **example**: _Object_ An object representing an example for documents to be matched against. -* **newValue**: _Object_ +- **newValue**: _Object_ The new value to update matching documents with. -* **opts**: _Object_ (optional) +- **opts**: _Object_ (optional) - For information on the possible options see - [the HTTP API for updating documents by example](../../../..//HTTP/SimpleQuery/index.html#update-documents-by-example). + For information on the possible options see the + [HTTP API for updating documents by example](../../../..//HTTP/SimpleQuery/index.html#update-documents-by-example). ## collection.lookupByKeys @@ -162,7 +166,7 @@ array of the matching documents. **Arguments** -* **keys**: _Array_ +- **keys**: _Array_ An array of document keys to look up. @@ -174,14 +178,14 @@ Deletes the documents with the given _keys_ from the collection. **Arguments** -* **keys**: _Array_ +- **keys**: _Array_ An array of document keys to delete. -* **opts**: _Object_ (optional) +- **opts**: _Object_ (optional) - For information on the possible options see - [the HTTP API for removing documents by keys](../../../..//HTTP/SimpleQuery/index.html#remove-documents-by-their-keys). + For information on the possible options see the + [HTTP API for removing documents by keys](../../../..//HTTP/SimpleQuery/index.html#remove-documents-by-their-keys). ## collection.fulltext @@ -191,15 +195,15 @@ Performs a fulltext query in the given _fieldName_ on the collection. **Arguments** -* **fieldName**: _String_ +- **fieldName**: _String_ Name of the field to search on documents in the collection. -* **query**: _String_ +- **query**: _String_ Fulltext query string to search for. -* **opts**: _Object_ (optional) +- **opts**: _Object_ (optional) - For information on the possible options see - [the HTTP API for fulltext queries](../../../..//HTTP/Indexes/Fulltext.html). + For information on the possible options see the + [HTTP API for fulltext queries](../../../..//HTTP/Indexes/Fulltext.html). diff --git a/Documentation/Books/Drivers/JS/Reference/Cursor.md b/Documentation/Books/Drivers/JS/Reference/Cursor.md index c76a3f9ccf..ffed42d31b 100644 --- a/Documentation/Books/Drivers/JS/Reference/Cursor.md +++ b/Documentation/Books/Drivers/JS/Reference/Cursor.md @@ -1,4 +1,4 @@ - + # Cursor API _Cursor_ instances provide an abstraction over the HTTP API's limitations. @@ -178,7 +178,7 @@ Advances the cursor by applying the function _fn_ to each value in the cursor's remaining result list until the cursor is exhausted or _fn_ returns a value that evaluates to `true`. -Returns `true` if _fn_ returned a value that evalutes to `true`, or `false` +Returns `true` if _fn_ returned a value that evaluates to `true`, or `false` otherwise. Equivalent to _Array.prototype.some_ (except async). diff --git a/Documentation/Books/Drivers/JS/Reference/Database/AqlUserFunctions.md b/Documentation/Books/Drivers/JS/Reference/Database/AqlUserFunctions.md index ddc2222731..4391a5b432 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/AqlUserFunctions.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/AqlUserFunctions.md @@ -1,4 +1,4 @@ - + # Managing AQL user functions These functions implement the diff --git a/Documentation/Books/Drivers/JS/Reference/Database/CollectionAccess.md b/Documentation/Books/Drivers/JS/Reference/Database/CollectionAccess.md index 4cd6df4b00..3c2be76df7 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/CollectionAccess.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/CollectionAccess.md @@ -1,4 +1,4 @@ - + # Accessing collections These functions implement the diff --git a/Documentation/Books/Drivers/JS/Reference/Database/DatabaseManipulation.md b/Documentation/Books/Drivers/JS/Reference/Database/DatabaseManipulation.md index 2279f4d318..093263b03e 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/DatabaseManipulation.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/DatabaseManipulation.md @@ -1,132 +1,9 @@ - + # Manipulating databases These functions implement the [HTTP API for manipulating databases](../../../..//HTTP/Database/index.html). -## database.acquireHostList - -`async database.acquireHostList(): this` - -Updates the URL list by requesting a list of all coordinators in the cluster and adding any endpoints not initially specified in the _url_ configuration. - -For long-running processes communicating with an ArangoDB cluster it is recommended to run this method repeatedly (e.g. once per hour) to make sure new coordinators are picked up correctly and can be used for fail-over or load balancing. - -**Note**: This method can not be used when the arangojs instance was created with `isAbsolute: true`. - -## database.useDatabase - -`database.useDatabase(databaseName): this` - -Updates the _Database_ instance and its connection string to use the given -_databaseName_, then returns itself. - -**Note**: This method can not be used when the arangojs instance was created with `isAbsolute: true`. - -**Arguments** - -- **databaseName**: `string` - - The name of the database to use. - -**Examples** - -```js -const db = new Database(); -db.useDatabase("test"); -// The database instance now uses the database "test". -``` - -## database.useBasicAuth - -`database.useBasicAuth([username, [password]]): this` - -Updates the _Database_ instance's `authorization` header to use Basic -authentication with the given _username_ and _password_, then returns itself. - -**Arguments** - -- **username**: `string` (Default: `"root"`) - - The username to authenticate with. - -- **password**: `string` (Default: `""`) - - The password to authenticate with. - -**Examples** - -```js -const db = new Database(); -db.useDatabase("test"); -db.useBasicAuth("admin", "hunter2"); -// The database instance now uses the database "test" -// with the username "admin" and password "hunter2". -``` - -## database.useBearerAuth - -`database.useBearerAuth(token): this` - -Updates the _Database_ instance's `authorization` header to use Bearer -authentication with the given authentication token, then returns itself. - -**Arguments** - -- **token**: `string` - - The token to authenticate with. - -**Examples** - -```js -const db = new Database(); -db.useBearerAuth("keyboardcat"); -// The database instance now uses Bearer authentication. -``` - -## database.login - -`async database.login([username, [password]]): string` - -Validates the given database credentials and exchanges them for an -authentication token, then uses the authentication token for future -requests and returns it. - -**Arguments** - -- **username**: `string` (Default: `"root"`) - - The username to authenticate with. - -- **password**: `string` (Default: `""`) - - The password to authenticate with. - -**Examples** - -```js -const db = new Database(); -db.useDatabase("test"); -await db.login("admin", "hunter2"); -// The database instance now uses the database "test" -// with an authentication token for the "admin" user. -``` - -## database.version - -`async database.version(): Object` - -Fetches the ArangoDB version information for the active database from the server. - -**Examples** - -```js -const db = new Database(); -const version = await db.version(); -// the version object contains the ArangoDB version information. -``` - ## database.createDatabase `async database.createDatabase(databaseName, [users]): Object` @@ -163,7 +40,7 @@ Creates a new database with the given _databaseName_. ```js const db = new Database(); -const info = await db.createDatabase('mydb', [{username: 'root'}]); +const info = await db.createDatabase("mydb", [{ username: "root" }]); // the database has been created ``` @@ -232,7 +109,7 @@ Deletes the database with the given _databaseName_ from the server. ```js const db = new Database(); -await db.dropDatabase('mydb'); +await db.dropDatabase("mydb"); // database "mydb" no longer exists ``` diff --git a/Documentation/Books/Drivers/JS/Reference/Database/FoxxServices.md b/Documentation/Books/Drivers/JS/Reference/Database/FoxxServices.md index d532e5e618..8c5e5f660a 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/FoxxServices.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/FoxxServices.md @@ -1,4 +1,4 @@ - + # Managing Foxx services ## database.listServices @@ -9,7 +9,7 @@ Fetches a list of all installed service. **Arguments** -* **excludeSystem**: `boolean` (Default: `true`) +- **excludeSystem**: `boolean` (Default: `true`) Whether system services should be excluded. @@ -31,56 +31,56 @@ Installs a new service. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **source**: `Buffer | Readable | File | string` +- **source**: `Buffer | Readable | File | string` The service bundle to install. -* **options**: `Object` (optional) +- **options**: `Object` (optional) An object with any of the following properties: - * **configuration**: `Object` (optional) + - **configuration**: `Object` (optional) An object mapping configuration option names to values. - * **dependencies**: `Object` (optional) + - **dependencies**: `Object` (optional) An object mapping dependency aliases to mount points. - * **development**: `boolean` (Default: `false`) + - **development**: `boolean` (Default: `false`) Whether the service should be installed in development mode. - * **legacy**: `boolean` (Default: `false`) + - **legacy**: `boolean` (Default: `false`) Whether the service should be installed in legacy compatibility mode. This overrides the `engines` option in the service manifest (if any). - * **setup**: `boolean` (Default: `true`) + - **setup**: `boolean` (Default: `true`) Whether the setup script should be executed. **Examples** ```js -const source = fs.createReadStream('./my-foxx-service.zip'); -const info = await db.installService('/hello', source); +const source = fs.createReadStream("./my-foxx-service.zip"); +const info = await db.installService("/hello", source); // -- or -- -const source = fs.readFileSync('./my-foxx-service.zip'); -const info = await db.installService('/hello', source); +const source = fs.readFileSync("./my-foxx-service.zip"); +const info = await db.installService("/hello", source); // -- or -- -const element = document.getElementById('my-file-input'); +const element = document.getElementById("my-file-input"); const source = element.files[0]; -const info = await db.installService('/hello', source); +const info = await db.installService("/hello", source); ``` ## database.replaceService @@ -92,64 +92,64 @@ service and installing a new service at the same mount point. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **source**: `Buffer | Readable | File | string` +- **source**: `Buffer | Readable | File | string` The service bundle to replace the existing service with. -* **options**: `Object` (optional) +- **options**: `Object` (optional) An object with any of the following properties: - * **configuration**: `Object` (optional) + - **configuration**: `Object` (optional) An object mapping configuration option names to values. This configuration will replace the existing configuration. - * **dependencies**: `Object` (optional) + - **dependencies**: `Object` (optional) An object mapping dependency aliases to mount points. These dependencies will replace the existing dependencies. - * **development**: `boolean` (Default: `false`) + - **development**: `boolean` (Default: `false`) Whether the new service should be installed in development mode. - * **legacy**: `boolean` (Default: `false`) + - **legacy**: `boolean` (Default: `false`) Whether the new service should be installed in legacy compatibility mode. This overrides the `engines` option in the service manifest (if any). - * **teardown**: `boolean` (Default: `true`) + - **teardown**: `boolean` (Default: `true`) Whether the teardown script of the old service should be executed. - * **setup**: `boolean` (Default: `true`) + - **setup**: `boolean` (Default: `true`) Whether the setup script of the new service should be executed. **Examples** ```js -const source = fs.createReadStream('./my-foxx-service.zip'); -const info = await db.replaceService('/hello', source); +const source = fs.createReadStream("./my-foxx-service.zip"); +const info = await db.replaceService("/hello", source); // -- or -- -const source = fs.readFileSync('./my-foxx-service.zip'); -const info = await db.replaceService('/hello', source); +const source = fs.readFileSync("./my-foxx-service.zip"); +const info = await db.replaceService("/hello", source); // -- or -- -const element = document.getElementById('my-file-input'); +const element = document.getElementById("my-file-input"); const source = element.files[0]; -const info = await db.replaceService('/hello', source); +const info = await db.replaceService("/hello", source); ``` ## database.upgradeService @@ -161,64 +161,64 @@ service's configuration and dependencies. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **source**: `Buffer | Readable | File | string` +- **source**: `Buffer | Readable | File | string` The service bundle to replace the existing service with. -* **options**: `Object` (optional) +- **options**: `Object` (optional) An object with any of the following properties: - * **configuration**: `Object` (optional) + - **configuration**: `Object` (optional) An object mapping configuration option names to values. This configuration will be merged into the existing configuration. - * **dependencies**: `Object` (optional) + - **dependencies**: `Object` (optional) An object mapping dependency aliases to mount points. These dependencies will be merged into the existing dependencies. - * **development**: `boolean` (Default: `false`) + - **development**: `boolean` (Default: `false`) Whether the new service should be installed in development mode. - * **legacy**: `boolean` (Default: `false`) + - **legacy**: `boolean` (Default: `false`) Whether the new service should be installed in legacy compatibility mode. This overrides the `engines` option in the service manifest (if any). - * **teardown**: `boolean` (Default: `false`) + - **teardown**: `boolean` (Default: `false`) Whether the teardown script of the old service should be executed. - * **setup**: `boolean` (Default: `true`) + - **setup**: `boolean` (Default: `true`) Whether the setup script of the new service should be executed. **Examples** ```js -const source = fs.createReadStream('./my-foxx-service.zip'); -const info = await db.upgradeService('/hello', source); +const source = fs.createReadStream("./my-foxx-service.zip"); +const info = await db.upgradeService("/hello", source); // -- or -- -const source = fs.readFileSync('./my-foxx-service.zip'); -const info = await db.upgradeService('/hello', source); +const source = fs.readFileSync("./my-foxx-service.zip"); +const info = await db.upgradeService("/hello", source); // -- or -- -const element = document.getElementById('my-file-input'); +const element = document.getElementById("my-file-input"); const source = element.files[0]; -const info = await db.upgradeService('/hello', source); +const info = await db.upgradeService("/hello", source); ``` ## database.uninstallService @@ -229,22 +229,22 @@ Completely removes a service from the database. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **options**: `Object` (optional) +- **options**: `Object` (optional) An object with any of the following properties: - * **teardown**: `boolean` (Default: `true`) + - **teardown**: `boolean` (Default: `true`) Whether the teardown script should be executed. **Examples** ```js -await db.uninstallService('/my-service'); +await db.uninstallService("/my-service"); // service was uninstalled ``` @@ -256,14 +256,14 @@ Retrieves information about a mounted service. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const info = await db.getService('/my-service'); +const info = await db.getService("/my-service"); // info contains detailed information about the service ``` @@ -276,39 +276,38 @@ and their current values. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **minimal**: `boolean` (Default: `false`) +- **minimal**: `boolean` (Default: `false`) Only return the current values. **Examples** ```js -const config = await db.getServiceConfiguration('/my-service'); +const config = await db.getServiceConfiguration("/my-service"); // config contains information about the service's configuration ``` ## database.replaceServiceConfiguration -`async database.replaceServiceConfiguration(mount, configuration, [minimal]): -Object` +`async database.replaceServiceConfiguration(mount, configuration, [minimal]): Object` Replaces the configuration of the given service. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **configuration**: `Object` +- **configuration**: `Object` An object mapping configuration option names to values. -* **minimal**: `boolean` (Default: `false`) +- **minimal**: `boolean` (Default: `false`) Only return the current values and warnings (if any). @@ -318,31 +317,30 @@ Replaces the configuration of the given service. **Examples** ```js -const config = {currency: 'USD', locale: 'en-US'}; -const info = await db.replaceServiceConfiguration('/my-service', config); +const config = { currency: "USD", locale: "en-US" }; +const info = await db.replaceServiceConfiguration("/my-service", config); // info.values contains information about the service's configuration // info.warnings contains any validation errors for the configuration ``` ## database.updateServiceConfiguration -`async database.updateServiceConfiguration(mount, configuration, [minimal]): -Object` +`async database.updateServiceConfiguration(mount, configuration, [minimal]): Object` Updates the configuration of the given service my merging the new values into the existing ones. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **configuration**: `Object` +- **configuration**: `Object` An object mapping configuration option names to values. -* **minimal**: `boolean` (Default: `false`) +- **minimal**: `boolean` (Default: `false`) Only return the current values and warnings (if any). @@ -352,8 +350,8 @@ the existing ones. **Examples** ```js -const config = {locale: 'en-US'}; -const info = await db.updateServiceConfiguration('/my-service', config); +const config = { locale: "en-US" }; +const info = await db.updateServiceConfiguration("/my-service", config); // info.values contains information about the service's configuration // info.warnings contains any validation errors for the configuration ``` @@ -367,39 +365,38 @@ current mount points. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **minimal**: `boolean` (Default: `false`) +- **minimal**: `boolean` (Default: `false`) Only return the current values and warnings (if any). **Examples** ```js -const deps = await db.getServiceDependencies('/my-service'); +const deps = await db.getServiceDependencies("/my-service"); // deps contains information about the service's dependencies ``` ## database.replaceServiceDependencies -`async database.replaceServiceDependencies(mount, dependencies, [minimal]): -Object` +`async database.replaceServiceDependencies(mount, dependencies, [minimal]): Object` Replaces the dependencies for the given service. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **dependencies**: `Object` +- **dependencies**: `Object` An object mapping dependency aliases to mount points. -* **minimal**: `boolean` (Default: `false`) +- **minimal**: `boolean` (Default: `false`) Only return the current values and warnings (if any). @@ -409,31 +406,30 @@ Replaces the dependencies for the given service. **Examples** ```js -const deps = {mailer: '/mailer-api', auth: '/remote-auth'}; -const info = await db.replaceServiceDependencies('/my-service', deps); +const deps = { mailer: "/mailer-api", auth: "/remote-auth" }; +const info = await db.replaceServiceDependencies("/my-service", deps); // info.values contains information about the service's dependencies // info.warnings contains any validation errors for the dependencies ``` ## database.updateServiceDependencies -`async database.updateServiceDependencies(mount, dependencies, [minimal]): -Object` +`async database.updateServiceDependencies(mount, dependencies, [minimal]): Object` Updates the dependencies for the given service by merging the new values into the existing ones. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **dependencies**: `Object` +- **dependencies**: `Object` An object mapping dependency aliases to mount points. -* **minimal**: `boolean` (Default: `false`) +- **minimal**: `boolean` (Default: `false`) Only return the current values and warnings (if any). @@ -443,8 +439,8 @@ the existing ones. **Examples** ```js -const deps = {mailer: '/mailer-api'}; -const info = await db.updateServiceDependencies('/my-service', deps); +const deps = { mailer: "/mailer-api" }; +const info = await db.updateServiceDependencies("/my-service", deps); // info.values contains information about the service's dependencies // info.warnings contains any validation errors for the dependencies ``` @@ -457,14 +453,14 @@ Enables development mode for the given service. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const info = await db.enableServiceDevelopmentMode('/my-service'); +const info = await db.enableServiceDevelopmentMode("/my-service"); // the service is now in development mode // info contains detailed information about the service ``` @@ -478,14 +474,14 @@ the database. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const info = await db.disableServiceDevelopmentMode('/my-service'); +const info = await db.disableServiceDevelopmentMode("/my-service"); // the service is now in production mode // info contains detailed information about the service ``` @@ -500,14 +496,14 @@ Returns an object mapping each name to a more readable representation. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const scripts = await db.listServiceScripts('/my-service'); +const scripts = await db.listServiceScripts("/my-service"); // scripts is an object listing the service scripts ``` @@ -519,22 +515,22 @@ Runs a service script and returns the result. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. -* **name**: `string` +- **name**: `string` Name of the script to execute. -* **scriptArg**: `any` +- **scriptArg**: `any` Value that will be passed as an argument to the script. **Examples** ```js -const result = await db.runServiceScript('/my-service', 'setup'); +const result = await db.runServiceScript("/my-service", "setup"); // result contains the script's exports (if any) ``` @@ -546,40 +542,40 @@ Runs the tests of a given service and returns a formatted report. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database -* **options**: `Object` (optional) +- **options**: `Object` (optional) An object with any of the following properties: - * **reporter**: `string` (Default: `default`) + - **reporter**: `string` (Default: `default`) The reporter to use to process the test results. As of ArangoDB 3.2 the following reporters are supported: - * **stream**: an array of event objects - * **suite**: nested suite objects with test results - * **xunit**: JSONML representation of an XUnit report - * **tap**: an array of TAP event strings - * **default**: an array of test results + - **stream**: an array of event objects + - **suite**: nested suite objects with test results + - **xunit**: JSONML representation of an XUnit report + - **tap**: an array of TAP event strings + - **default**: an array of test results - * **idiomatic**: `boolean` (Default: `false`) + - **idiomatic**: `boolean` (Default: `false`) Whether the results should be converted to the apropriate `string` representation: - * **xunit** reports will be formatted as XML documents - * **tap** reports will be formatted as TAP streams - * **stream** reports will be formatted as JSON-LD streams + - **xunit** reports will be formatted as XML documents + - **tap** reports will be formatted as TAP streams + - **stream** reports will be formatted as JSON-LD streams **Examples** ```js -const opts = {reporter: 'xunit', idiomatic: true}; -const result = await db.runServiceTests('/my-service', opts); +const opts = { reporter: "xunit", idiomatic: true }; +const result = await db.runServiceTests("/my-service", opts); // result contains the XUnit report as a string ``` @@ -593,14 +589,14 @@ Returns a `Buffer` in Node or `Blob` in the browser version. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const bundle = await db.downloadService('/my-service'); +const bundle = await db.downloadService("/my-service"); // bundle is a Buffer/Blob of the service bundle ``` @@ -614,14 +610,14 @@ Returns `undefined` if no such file could be found. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const readme = await db.getServiceReadme('/my-service'); +const readme = await db.getServiceReadme("/my-service"); // readme is a string containing the service README's // text content, or undefined if no README exists ``` @@ -635,14 +631,14 @@ given mount point. **Arguments** -* **mount**: `string` +- **mount**: `string` The service's mount point, relative to the database. **Examples** ```js -const spec = await db.getServiceDocumentation('/my-service'); +const spec = await db.getServiceDocumentation("/my-service"); // spec is a Swagger API description of the service ``` @@ -655,7 +651,7 @@ bundles missing in the database. **Arguments** -* **replace**: `boolean` (Default: `false`) +- **replace**: `boolean` (Default: `false`) Also commit outdated services. diff --git a/Documentation/Books/Drivers/JS/Reference/Database/GraphAccess.md b/Documentation/Books/Drivers/JS/Reference/Database/GraphAccess.md index a2dff34e63..b1f18fdce9 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/GraphAccess.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/GraphAccess.md @@ -1,4 +1,4 @@ - + # Accessing graphs These functions implement the diff --git a/Documentation/Books/Drivers/JS/Reference/Database/HttpRoutes.md b/Documentation/Books/Drivers/JS/Reference/Database/HttpRoutes.md index d9219f549e..69e0c687ab 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/HttpRoutes.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/HttpRoutes.md @@ -1,4 +1,4 @@ - + # Arbitrary HTTP routes ## database.route diff --git a/Documentation/Books/Drivers/JS/Reference/Database/Queries.md b/Documentation/Books/Drivers/JS/Reference/Database/Queries.md index 8688fbeea6..8c37736f8d 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/Queries.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/Queries.md @@ -1,10 +1,10 @@ - + # Queries This function implements the -[HTTP API for single roundtrip AQL queries](../../../..//HTTP/AqlQueryCursor/QueryResults.html). +[HTTP API for single round-trip AQL queries](../../../..//HTTP/AqlQueryCursor/QueryResults.html). -For collection-specific queries see [simple queries](../Collection/SimpleQueries.md). +For collection-specific queries see [Simple Queries](../Collection/SimpleQueries.md). ## database.query @@ -31,8 +31,11 @@ Performs a database query using the given _query_ and _bindVars_, then returns a If _opts.count_ is set to `true`, the cursor will have a _count_ property set to the query result count. -Possible key options in _opts.options_ include: _failOnWarning_, _cache_, profile or _skipInaccessibleCollections_. -For a complete list of query settings please reference the [arangodb.com documentation](../../../..//AQL/Invocation/WithArangosh.html#setting-options). + +Possible key options in _opts.options_ include: _failOnWarning_, _cache_, +profile or _skipInaccessibleCollections_. +For a complete list of query settings please reference the +[setting options](../../../..//AQL/Invocation/WithArangosh.html#setting-options). If _query_ is an object with _query_ and _bindVars_ properties, those will be used as the values of the respective arguments instead. diff --git a/Documentation/Books/Drivers/JS/Reference/Database/README.md b/Documentation/Books/Drivers/JS/Reference/Database/README.md index 6c48faad81..ffedc7b229 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/README.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/README.md @@ -1,4 +1,4 @@ - + # Database API ## new Database @@ -20,12 +20,15 @@ If _config_ is a string, it will be interpreted as _config.url_. Base URL of the ArangoDB server or list of server URLs. When working with a cluster or a single server with leader/follower failover, - [the method `db.acquireHostList`](DatabaseManipulation.md#databaseacquirehostlist) + [the method `db.acquireHostList`](#databaseacquirehostlist) can be used to automatically pick up additional coordinators/followers at any point. - **Note**: As of arangojs 6.0.0 it is no longer possible to pass - the username or password from the URL. + {% hint 'warning' %} + As of arangojs 6.0.0 it is no longer possible to pass + the username or password from the URL. Use + [`database.useBasicAuth`](#databaseusebasicauth) instead. + {% endhint %} If you want to use ArangoDB with authentication, see _useBasicAuth_ or _useBearerAuth_ methods. @@ -51,17 +54,13 @@ If _config_ is a string, it will be interpreted as _config.url_. - **arangoVersion**: `number` (Default: `30000`) - Value of the `x-arango-version` header. This should match the lowest - version of ArangoDB you expect to be using. The format is defined as - `XYYZZ` where `X` is the major version, `Y` is the two-digit minor version - and `Z` is the two-digit bugfix version. + Numeric representation of the ArangoDB version the driver should expect. + The format is defined as `XYYZZ` where `X` is the major version, `Y` is + the zero-filled two-digit minor version and `Z` is the zero-filled two-digit + bugfix version, e.g. `30102` for 3.1.2, `20811` for 2.8.11. - **Example**: `30102` corresponds to version 3.1.2 of ArangoDB. - - **Note**: The driver will behave differently when using different major - versions of ArangoDB to compensate for API changes. Some functions are - not available on every major version of ArangoDB as indicated in their - descriptions below (e.g. _collection.first_, _collection.bulkUpdate_). + Depending on this value certain methods may become unavailable or change + their behavior to remain compatible with different versions of ArangoDB. - **headers**: `Object` (optional) @@ -134,6 +133,135 @@ If _config_ is a string, it will be interpreted as _config.url_. **Note**: Requests bound to a specific server (e.g. fetching query results) will never be retried automatically and ignore this setting. +## database.acquireHostList + +`async database.acquireHostList(): this` + +Updates the URL list by requesting a list of all coordinators in the cluster +and adding any endpoints not initially specified in the _url_ configuration. + +For long-running processes communicating with an ArangoDB cluster it is +recommended to run this method repeatedly (e.g. once per hour) to make sure +new coordinators are picked up correctly and can be used for fail-over or +load balancing. + +**Note**: This method can not be used when the arangojs instance was created +with `isAbsolute: true`. + +## database.useDatabase + +`database.useDatabase(databaseName): this` + +Updates the _Database_ instance and its connection string to use the given +_databaseName_, then returns itself. + +**Note**: This method can not be used when the arangojs instance was created +with `isAbsolute: true`. + +**Arguments** + +- **databaseName**: `string` + + The name of the database to use. + +**Examples** + +```js +const db = new Database(); +db.useDatabase("test"); +// The database instance now uses the database "test". +``` + +## database.useBasicAuth + +`database.useBasicAuth([username, [password]]): this` + +Updates the _Database_ instance's `authorization` header to use Basic +authentication with the given _username_ and _password_, then returns itself. + +**Arguments** + +- **username**: `string` (Default: `"root"`) + + The username to authenticate with. + +- **password**: `string` (Default: `""`) + + The password to authenticate with. + +**Examples** + +```js +const db = new Database(); +db.useDatabase("test"); +db.useBasicAuth("admin", "hunter2"); +// The database instance now uses the database "test" +// with the username "admin" and password "hunter2". +``` + +## database.useBearerAuth + +`database.useBearerAuth(token): this` + +Updates the _Database_ instance's `authorization` header to use Bearer +authentication with the given authentication token, then returns itself. + +**Arguments** + +- **token**: `string` + + The token to authenticate with. + +**Examples** + +```js +const db = new Database(); +db.useBearerAuth("keyboardcat"); +// The database instance now uses Bearer authentication. +``` + +## database.login + +`async database.login([username, [password]]): string` + +Validates the given database credentials and exchanges them for an +authentication token, then uses the authentication token for future +requests and returns it. + +**Arguments** + +- **username**: `string` (Default: `"root"`) + + The username to authenticate with. + +- **password**: `string` (Default: `""`) + + The password to authenticate with. + +**Examples** + +```js +const db = new Database(); +db.useDatabase("test"); +await db.login("admin", "hunter2"); +// The database instance now uses the database "test" +// with an authentication token for the "admin" user. +``` + +## database.version + +`async database.version(): Object` + +Fetches the ArangoDB version information for the active database from the server. + +**Examples** + +```js +const db = new Database(); +const version = await db.version(); +// the version object contains the ArangoDB version information. +``` + ## database.close `database.close(): void` diff --git a/Documentation/Books/Drivers/JS/Reference/Database/Transactions.md b/Documentation/Books/Drivers/JS/Reference/Database/Transactions.md index 6b209f5312..e3955725ac 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/Transactions.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/Transactions.md @@ -1,4 +1,4 @@ - + # Transactions This function implements the @@ -6,62 +6,65 @@ This function implements the ## database.transaction -`async database.transaction(collections, action, [params, [options]]): -Object` +`async database.transaction(collections, action, [params, [options]]): Object` Performs a server-side transaction and returns its return value. **Arguments** -* **collections**: `Object` +- **collections**: `Object` An object with the following properties: - * **read**: `Array` (optional) + - **read**: `Array` (optional) An array of names (or a single name) of collections that will be read from during the transaction. - * **write**: `Array` (optional) + - **write**: `Array` (optional) An array of names (or a single name) of collections that will be written to or read from during the transaction. -* **action**: `string` +- **action**: `string` A string evaluating to a JavaScript function to be executed on the server. - **Note**: For accessing the database from within ArangoDB, see - [the documentation for the `@arangodb` module in ArangoDB](../../../..//Manual/Appendix/JavaScriptModules/ArangoDB.html). + {% hint 'warning ' %} + This function will be executed on the server inside ArangoDB and can not use + the arangojs driver or any variables other than those passed as _params_. + For accessing the database from within ArangoDB, see the documentation for the + [`@arangodb` module in ArangoDB](../../../..//Manual/Appendix/JavaScriptModules/ArangoDB.html). + {% endhint %} -* **params**: `Object` (optional) +- **params**: `Object` (optional) Available as variable `params` when the _action_ function is being executed on server. Check the example below. -* **options**: `Object` (optional) +- **options**: `Object` (optional) An object with any of the following properties: - * **lockTimeout**: `number` (optional) + - **lockTimeout**: `number` (optional) Determines how long the database will wait while attempting to gain locks on collections used by the transaction before timing out. - * **waitForSync**: `boolean` (optional) + - **waitForSync**: `boolean` (optional) Determines whether to force the transaction to write all data to disk before returning. - * **maxTransactionSize**: `number` (optional) + - **maxTransactionSize**: `number` (optional) Determines the transaction size limit in bytes. Honored by the RocksDB storage engine only. - * **intermediateCommitCount**: `number` (optional) + - **intermediateCommitCount**: `number` (optional) Determines the maximum number of operations after which an intermediate commit is performed automatically. Honored by the RocksDB storage engine only. - * **intermediateCommitSize**: `number` (optional) + - **intermediateCommitSize**: `number` (optional) Determine the maximum total size of operations after which an intermediate commit is performed automatically. Honored by the RocksDB storage engine only. @@ -74,27 +77,27 @@ JavaScript function, it's not possible to pass in a JavaScript function directly because the function needs to be evaluated on the server and will be transmitted in plain text. -For more information on transactions, see -[the HTTP API documentation for transactions](../../../..//HTTP/Transaction/index.html). +For more information on transactions, see the +[HTTP API documentation for transactions](../../../..//HTTP/Transaction/index.html). **Examples** ```js const db = new Database(); -const action = String(function (params) { +const action = String(function(params) { // This code will be executed inside ArangoDB! - const db = require('@arangodb').db; - return db._query(aql` + const db = require("@arangodb").db; + return db + ._query( + aql` FOR user IN _users FILTER user.age > ${params.age} RETURN u.user - `).toArray(); + ` + ) + .toArray(); }); -const result = await db.transaction( - {read: '_users'}, - action, - {age: 12} -); +const result = await db.transaction({ read: "_users" }, action, { age: 12 }); // result contains the return value of the action ``` diff --git a/Documentation/Books/Drivers/JS/Reference/Database/ViewAccess.md b/Documentation/Books/Drivers/JS/Reference/Database/ViewAccess.md index 094770012b..9cb1f51675 100644 --- a/Documentation/Books/Drivers/JS/Reference/Database/ViewAccess.md +++ b/Documentation/Books/Drivers/JS/Reference/Database/ViewAccess.md @@ -1,4 +1,4 @@ - + # Accessing views These functions implement the @@ -8,13 +8,18 @@ These functions implement the `database.arangoSearchView(viewName): ArangoSearchView` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} + Returns a _ArangoSearchView_ instance for the given view name. **Arguments** - **viewName**: `string` - Name of the `arangosearch` view. + Name of the arangosearch view. **Examples** @@ -27,6 +32,11 @@ const view = db.arangoSearchView("potatoes"); `async database.listViews(): Array` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} + Fetches all views from the database and returns an array of view descriptions. @@ -43,6 +53,11 @@ const views = await db.listViews(); `async database.views([excludeSystem]): Array` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../../GettingStarted/README.md#compatibility). +{% endhint %} + Fetches all views from the database and returns an array of _ArangoSearchView_ instances for the views. @@ -51,6 +66,6 @@ _ArangoSearchView_ instances for the views. ```js const db = new Database(); -const views = await db.views() +const views = await db.views(); // views is an array of ArangoSearchView instances ``` diff --git a/Documentation/Books/Drivers/JS/Reference/Graph/EdgeCollection.md b/Documentation/Books/Drivers/JS/Reference/Graph/EdgeCollection.md index 54013684ca..7dcfad62ef 100644 --- a/Documentation/Books/Drivers/JS/Reference/Graph/EdgeCollection.md +++ b/Documentation/Books/Drivers/JS/Reference/Graph/EdgeCollection.md @@ -1,4 +1,4 @@ - + # GraphEdgeCollection API The _GraphEdgeCollection API_ extends the diff --git a/Documentation/Books/Drivers/JS/Reference/Graph/Edges.md b/Documentation/Books/Drivers/JS/Reference/Graph/Edges.md index 6b5a818b71..e9d24739c0 100644 --- a/Documentation/Books/Drivers/JS/Reference/Graph/Edges.md +++ b/Documentation/Books/Drivers/JS/Reference/Graph/Edges.md @@ -1,4 +1,4 @@ - + # Manipulating edges ## graph.edgeCollection diff --git a/Documentation/Books/Drivers/JS/Reference/Graph/README.md b/Documentation/Books/Drivers/JS/Reference/Graph/README.md index 23d92d35ec..c288a67445 100644 --- a/Documentation/Books/Drivers/JS/Reference/Graph/README.md +++ b/Documentation/Books/Drivers/JS/Reference/Graph/README.md @@ -1,4 +1,4 @@ - + # Graph API These functions implement the diff --git a/Documentation/Books/Drivers/JS/Reference/Graph/VertexCollection.md b/Documentation/Books/Drivers/JS/Reference/Graph/VertexCollection.md index 573270367c..c18dada54c 100644 --- a/Documentation/Books/Drivers/JS/Reference/Graph/VertexCollection.md +++ b/Documentation/Books/Drivers/JS/Reference/Graph/VertexCollection.md @@ -1,4 +1,4 @@ - + # GraphVertexCollection API The _GraphVertexCollection API_ extends the diff --git a/Documentation/Books/Drivers/JS/Reference/Graph/Vertices.md b/Documentation/Books/Drivers/JS/Reference/Graph/Vertices.md index 6ab1e45495..2c8fa51ae4 100644 --- a/Documentation/Books/Drivers/JS/Reference/Graph/Vertices.md +++ b/Documentation/Books/Drivers/JS/Reference/Graph/Vertices.md @@ -1,4 +1,4 @@ - + # Manipulating vertices ## graph.vertexCollection diff --git a/Documentation/Books/Drivers/JS/Reference/README.md b/Documentation/Books/Drivers/JS/Reference/README.md index 891e41ef49..705994aff9 100644 --- a/Documentation/Books/Drivers/JS/Reference/README.md +++ b/Documentation/Books/Drivers/JS/Reference/README.md @@ -1,4 +1,4 @@ - + # ArangoDB JavaScript Driver - Reference - [Database](Database/README.md) diff --git a/Documentation/Books/Drivers/JS/Reference/Route.md b/Documentation/Books/Drivers/JS/Reference/Route.md index 5c87f8ae51..1426398b14 100644 --- a/Documentation/Books/Drivers/JS/Reference/Route.md +++ b/Documentation/Books/Drivers/JS/Reference/Route.md @@ -1,4 +1,4 @@ - + # Route API _Route_ instances provide access for arbitrary HTTP requests. This allows easy diff --git a/Documentation/Books/Drivers/JS/Reference/ViewManipulation.md b/Documentation/Books/Drivers/JS/Reference/ViewManipulation.md index 0f91360463..bf8e95b605 100644 --- a/Documentation/Books/Drivers/JS/Reference/ViewManipulation.md +++ b/Documentation/Books/Drivers/JS/Reference/ViewManipulation.md @@ -1,4 +1,4 @@ - + # View API These functions implement the @@ -8,13 +8,18 @@ These functions implement the `async view.exists(): boolean` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Checks whether the view exists. **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); +const view = db.arangoSearchView("some-view"); const result = await view.exists(); // result indicates whether the view exists ``` @@ -23,13 +28,18 @@ const result = await view.exists(); `async view.get(): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Retrieves general information about the view. **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); +const view = db.arangoSearchView("some-view"); const data = await view.get(); // data contains general information about the view ``` @@ -38,13 +48,18 @@ const data = await view.get(); `async view.properties(): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Retrieves the view's properties. **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); +const view = db.arangoSearchView("some-view"); const data = await view.properties(); // data contains the view's properties ``` @@ -53,6 +68,11 @@ const data = await view.properties(); `async view.create([properties]): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Creates a view with the given _properties_ for this view's name, then returns the server response. @@ -60,15 +80,15 @@ then returns the server response. - **properties**: `Object` (optional) - For more information on the _properties_ object, see - [the HTTP API documentation for creating views](../../..//HTTP/Views/ArangoSearch.html). + For more information on the _properties_ object, see the + [HTTP API documentation for creating views](../../..//HTTP/Views/ArangoSearch.html). **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('potatoes'); -await view.create() +const view = db.arangoSearchView("potatoes"); +await view.create(); // the arangosearch view "potatoes" now exists ``` @@ -76,50 +96,65 @@ await view.create() `async view.setProperties(properties): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Updates the properties of the view. **Arguments** - **properties**: `Object` - For information on the _properties_ argument see - [the HTTP API for modifying views](../../..//HTTP/Views/ArangoSearch.html). + For information on the _properties_ argument see the + [HTTP API for modifying views](../../..//HTTP/Views/ArangoSearch.html). **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); -const result = await view.setProperties({ locale: "C" }) -assert.equal(result.locale, "C"); +const view = db.arangoSearchView("some-view"); +const result = await view.setProperties({ consolidationIntervalMsec: 123 }); +assert.equal(result.consolidationIntervalMsec, 123); ``` ## view.replaceProperties `async view.replaceProperties(properties): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Replaces the properties of the view. **Arguments** - **properties**: `Object` - For information on the _properties_ argument see - [the HTTP API for modifying views](../../..//HTTP/Views/ArangoSearch.html). + For information on the _properties_ argument see the + [HTTP API for modifying views](../../..//HTTP/Views/ArangoSearch.html). **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); -const result = await view.replaceProperties({ locale: "C" }) -assert.equal(result.locale, "C"); +const view = db.arangoSearchView("some-view"); +const result = await view.replaceProperties({ consolidationIntervalMsec: 234 }); +assert.equal(result.consolidationIntervalMsec, 234); ``` ## view.rename `async view.rename(name): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Renames the view. The _View_ instance will automatically update its name when the rename succeeds. @@ -127,9 +162,9 @@ name when the rename succeeds. ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); -const result = await view.rename('new-view-name') -assert.equal(result.name, 'new-view-name'); +const view = db.arangoSearchView("some-view"); +const result = await view.rename("new-view-name"); +assert.equal(result.name, "new-view-name"); assert.equal(view.name, result.name); // result contains additional information about the view ``` @@ -138,13 +173,18 @@ assert.equal(view.name, result.name); `async view.drop(): Object` +{% hint 'info' %} +This method is only available when targeting ArangoDB 3.4 or later, +see [Compatibility](../GettingStarted/README.md#compatibility). +{% endhint %} + Deletes the view from the database. **Examples** ```js const db = new Database(); -const view = db.arangoSearchView('some-view'); +const view = db.arangoSearchView("some-view"); await view.drop(); // the view "some-view" no longer exists ``` diff --git a/Documentation/Books/Drivers/Java/GettingStarted/README.md b/Documentation/Books/Drivers/Java/GettingStarted/README.md index 48b8924c41..da8660a82a 100644 --- a/Documentation/Books/Drivers/Java/GettingStarted/README.md +++ b/Documentation/Books/Drivers/Java/GettingStarted/README.md @@ -1,10 +1,11 @@ - + # ArangoDB Java Driver - Getting Started ## Supported versions + @@ -26,7 +27,7 @@ ArangoDB 3.x.x com.arangodb arangodb-java-driver - 4.6.0 + 5.0.0 ``` diff --git a/Documentation/Books/Drivers/Java/README.md b/Documentation/Books/Drivers/Java/README.md index 71ef332fd9..ee7da9e33a 100644 --- a/Documentation/Books/Drivers/Java/README.md +++ b/Documentation/Books/Drivers/Java/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Java Driver The official ArangoDB Java Driver. diff --git a/Documentation/Books/Drivers/Java/Reference/Collection/BulkImport.md b/Documentation/Books/Drivers/Java/Reference/Collection/BulkImport.md index f6a0616e3b..9a3becb039 100644 --- a/Documentation/Books/Drivers/Java/Reference/Collection/BulkImport.md +++ b/Documentation/Books/Drivers/Java/Reference/Collection/BulkImport.md @@ -1,4 +1,4 @@ - + # Bulk importing documents This function implements the diff --git a/Documentation/Books/Drivers/Java/Reference/Collection/CollectionManipulation.md b/Documentation/Books/Drivers/Java/Reference/Collection/CollectionManipulation.md index 8870d7ea09..4247d4645c 100644 --- a/Documentation/Books/Drivers/Java/Reference/Collection/CollectionManipulation.md +++ b/Documentation/Books/Drivers/Java/Reference/Collection/CollectionManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating the collection These functions implement @@ -73,8 +73,8 @@ Creates a collection with the given _options_ for this collection's name, then r ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -db.createCollection("potatoes", new CollectionCreateOptions()); -// the document collection "potatoes" now exists +db.createCollection("potatos", new CollectionCreateOptions()); +// the document collection "potatos" now exists ``` ## ArangoCollection.create @@ -144,9 +144,9 @@ Alternative for [ArangoDatabase.createCollection](#arangodatabasecreatecollectio ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoCollection collection = db.collection("potatoes"); +ArangoCollection collection = db.collection("potatos"); collection.create(new CollectionCreateOptions()); -// the document collection "potatoes" now exists +// the document collection "potatos" now exists ``` ## ArangoCollection.load diff --git a/Documentation/Books/Drivers/Java/Reference/Collection/DocumentManipulation.md b/Documentation/Books/Drivers/Java/Reference/Collection/DocumentManipulation.md index ce95cba342..757cb1d1b5 100644 --- a/Documentation/Books/Drivers/Java/Reference/Collection/DocumentManipulation.md +++ b/Documentation/Books/Drivers/Java/Reference/Collection/DocumentManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating documents These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Collection/Indexes.md b/Documentation/Books/Drivers/Java/Reference/Collection/Indexes.md index a8d133aeb1..00fec902c0 100644 --- a/Documentation/Books/Drivers/Java/Reference/Collection/Indexes.md +++ b/Documentation/Books/Drivers/Java/Reference/Collection/Indexes.md @@ -1,4 +1,4 @@ - + # Manipulating indexes These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Collection/README.md b/Documentation/Books/Drivers/Java/Reference/Collection/README.md index 8400e8a744..9cbbe9a9fd 100644 --- a/Documentation/Books/Drivers/Java/Reference/Collection/README.md +++ b/Documentation/Books/Drivers/Java/Reference/Collection/README.md @@ -1,4 +1,4 @@ - + # Collection API These functions implement the @@ -26,7 +26,7 @@ Checks whether the collection exists ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoCollection collection = db.collection("potatoes"); +ArangoCollection collection = db.collection("potatos"); boolean exists = collection.exists(); ``` @@ -44,7 +44,7 @@ Returns information about the collection. ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoCollection collection = db.collection("potatoes"); +ArangoCollection collection = db.collection("potatos"); CollectionEntity info = collection.getInfo(); ``` @@ -62,7 +62,7 @@ Reads the properties of the specified collection. ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoCollection collection = db.collection("potatoes"); +ArangoCollection collection = db.collection("potatos"); CollectionPropertiesEntity properties = collection.getProperties(); ``` @@ -80,7 +80,7 @@ Retrieve the collections revision. ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoCollection collection = db.collection("potatoes"); +ArangoCollection collection = db.collection("potatos"); CollectionRevisionEntity revision = collection.getRevision(); ``` @@ -98,7 +98,7 @@ Fetches a list of all indexes on this collection. ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoCollection collection = db.collection("potatoes"); +ArangoCollection collection = db.collection("potatos"); Collection indexes = collection.getIndexes(); ``` diff --git a/Documentation/Books/Drivers/Java/Reference/Cursor.md b/Documentation/Books/Drivers/Java/Reference/Cursor.md index ad733a6b8d..edb85bc6b8 100644 --- a/Documentation/Books/Drivers/Java/Reference/Cursor.md +++ b/Documentation/Books/Drivers/Java/Reference/Cursor.md @@ -1,4 +1,4 @@ - + # Cursor API _ArangoCursor_ instances provide an abstraction over the HTTP API's limitations. Unless a method explicitly exhausts the cursor, the driver will only fetch as many batches from the server as necessary. Like the server-side cursors, _ArangoCursor_ instances are incrementally depleted as they are read from. diff --git a/Documentation/Books/Drivers/Java/Reference/Database/AqlUserFunctions.md b/Documentation/Books/Drivers/Java/Reference/Database/AqlUserFunctions.md index 5e1b2cf2a8..274940ed45 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/AqlUserFunctions.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/AqlUserFunctions.md @@ -1,4 +1,4 @@ - + # Managing AQL user functions These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Database/CollectionAccess.md b/Documentation/Books/Drivers/Java/Reference/Database/CollectionAccess.md index 7457496cf0..e48f75f160 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/CollectionAccess.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/CollectionAccess.md @@ -1,4 +1,4 @@ - + # Accessing collections These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Database/DatabaseManipulation.md b/Documentation/Books/Drivers/Java/Reference/Database/DatabaseManipulation.md index 14267dd977..8451c6123b 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/DatabaseManipulation.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/DatabaseManipulation.md @@ -1,4 +1,4 @@ - + # Manipulation databases These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Database/GraphAccess.md b/Documentation/Books/Drivers/Java/Reference/Database/GraphAccess.md index cfce964694..a227360dfd 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/GraphAccess.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/GraphAccess.md @@ -1,4 +1,4 @@ - + # Accessing graphs These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Database/HttpRoutes.md b/Documentation/Books/Drivers/Java/Reference/Database/HttpRoutes.md index 5d601671a4..aca43ab56c 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/HttpRoutes.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/HttpRoutes.md @@ -1,4 +1,4 @@ - + # Arbitrary HTTP routes ## ArangoDatabase.route diff --git a/Documentation/Books/Drivers/Java/Reference/Database/Queries.md b/Documentation/Books/Drivers/Java/Reference/Database/Queries.md index 56854ab2b2..900ba09224 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/Queries.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/Queries.md @@ -1,4 +1,4 @@ - + # Queries This function implements the @@ -78,7 +78,7 @@ Performs a database query using the given _query_ and _bindVars_, then returns a - **fullCount**: `Boolean` - 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. + 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 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 will only be present in the result if the query has a LIMIT clause and the LIMIT clause is actually used in the query. - **maxPlans**: `Integer` diff --git a/Documentation/Books/Drivers/Java/Reference/Database/README.md b/Documentation/Books/Drivers/Java/Reference/Database/README.md index 702e8e0e2d..110a01eef8 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/README.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/README.md @@ -1,4 +1,4 @@ - + # Database API ## ArangoDB.db diff --git a/Documentation/Books/Drivers/Java/Reference/Database/Transactions.md b/Documentation/Books/Drivers/Java/Reference/Database/Transactions.md index 0d8b70b080..6f543b38ac 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/Transactions.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/Transactions.md @@ -1,4 +1,4 @@ - + # Transactions This function implements the diff --git a/Documentation/Books/Drivers/Java/Reference/Database/ViewAccess.md b/Documentation/Books/Drivers/Java/Reference/Database/ViewAccess.md index 3d146e0f37..ecf24fe30e 100644 --- a/Documentation/Books/Drivers/Java/Reference/Database/ViewAccess.md +++ b/Documentation/Books/Drivers/Java/Reference/Database/ViewAccess.md @@ -1,4 +1,4 @@ - + # Accessing views These functions implement the @@ -32,7 +32,7 @@ ArangoView view = db.view("myView"); ArangoDatabase.arangoSearch(String name) : ArangoSearch ``` -Returns a _ArangoSearch_ instance for the given ArangoSearch View name. +Returns a _ArangoSearch_ instance for the given ArangoSearch view name. **Arguments** diff --git a/Documentation/Books/Drivers/Java/Reference/Graph/EdgeCollection.md b/Documentation/Books/Drivers/Java/Reference/Graph/EdgeCollection.md index 978b85e607..c9c8c8d6d3 100644 --- a/Documentation/Books/Drivers/Java/Reference/Graph/EdgeCollection.md +++ b/Documentation/Books/Drivers/Java/Reference/Graph/EdgeCollection.md @@ -1,4 +1,4 @@ - + # Manipulating the edge collection ## ArangoGraph.edgeCollection diff --git a/Documentation/Books/Drivers/Java/Reference/Graph/Edges.md b/Documentation/Books/Drivers/Java/Reference/Graph/Edges.md index e7c2064fcc..400a654b6b 100644 --- a/Documentation/Books/Drivers/Java/Reference/Graph/Edges.md +++ b/Documentation/Books/Drivers/Java/Reference/Graph/Edges.md @@ -1,4 +1,4 @@ - + # Manipulating edges ## ArangoEdgeCollection.getEdge diff --git a/Documentation/Books/Drivers/Java/Reference/Graph/README.md b/Documentation/Books/Drivers/Java/Reference/Graph/README.md index 68a1021091..b72a19460c 100644 --- a/Documentation/Books/Drivers/Java/Reference/Graph/README.md +++ b/Documentation/Books/Drivers/Java/Reference/Graph/README.md @@ -1,4 +1,4 @@ - + # Graph API These functions implement the diff --git a/Documentation/Books/Drivers/Java/Reference/Graph/VertexCollection.md b/Documentation/Books/Drivers/Java/Reference/Graph/VertexCollection.md index dc1b8fff3c..e1969e30cd 100644 --- a/Documentation/Books/Drivers/Java/Reference/Graph/VertexCollection.md +++ b/Documentation/Books/Drivers/Java/Reference/Graph/VertexCollection.md @@ -1,4 +1,4 @@ - + # Manipulating the vertex collection ## ArangoGraph.vertexCollection diff --git a/Documentation/Books/Drivers/Java/Reference/Graph/Vertices.md b/Documentation/Books/Drivers/Java/Reference/Graph/Vertices.md index c25540a763..6668695e57 100644 --- a/Documentation/Books/Drivers/Java/Reference/Graph/Vertices.md +++ b/Documentation/Books/Drivers/Java/Reference/Graph/Vertices.md @@ -1,4 +1,4 @@ - + # Manipulating vertices ## ArangoVertexCollection.getVertex diff --git a/Documentation/Books/Drivers/Java/Reference/README.md b/Documentation/Books/Drivers/Java/Reference/README.md index d42492d9f1..c986f37b1b 100644 --- a/Documentation/Books/Drivers/Java/Reference/README.md +++ b/Documentation/Books/Drivers/Java/Reference/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Java Driver - Reference - [Driver Setup](Setup.md) diff --git a/Documentation/Books/Drivers/Java/Reference/Route.md b/Documentation/Books/Drivers/Java/Reference/Route.md index 48955f9d2a..926c7929bf 100644 --- a/Documentation/Books/Drivers/Java/Reference/Route.md +++ b/Documentation/Books/Drivers/Java/Reference/Route.md @@ -1,4 +1,4 @@ - + # Route API _ArangoRoute_ instances provide access for arbitrary HTTP requests. This allows easy access to Foxx services and other HTTP APIs not covered by the driver itself. diff --git a/Documentation/Books/Drivers/Java/Reference/Serialization.md b/Documentation/Books/Drivers/Java/Reference/Serialization.md index de432db0fa..7a0b70336f 100644 --- a/Documentation/Books/Drivers/Java/Reference/Serialization.md +++ b/Documentation/Books/Drivers/Java/Reference/Serialization.md @@ -1,4 +1,4 @@ - + # Serialization ## VelocyPack serialization diff --git a/Documentation/Books/Drivers/Java/Reference/Setup.md b/Documentation/Books/Drivers/Java/Reference/Setup.md index ae132c4fe7..4380d25bf8 100644 --- a/Documentation/Books/Drivers/Java/Reference/Setup.md +++ b/Documentation/Books/Drivers/Java/Reference/Setup.md @@ -1,4 +1,4 @@ - + # Driver setup Setup with default configuration, this automatically loads a properties file arangodb.properties if exists in the classpath: @@ -74,7 +74,7 @@ To use SSL, you have to set the configuration `useSsl` to `true` and set a `SSLC ## Connection Pooling -The driver supports connection pooling for VelocyStream with a default of 1 and HTTP with a default of 20 maximum connections. To change this value use the method `maxConnections(Integer)` in `ArangoDB.Builder`. +The driver supports connection pooling for VelocyStream with a default of 1 and HTTP with a default of 20 maximum connections per host. To change this value use the method `maxConnections(Integer)` in `ArangoDB.Builder`. ```Java ArangoDB arangoDB = new ArangoDB.Builder().maxConnections(8).build(); @@ -104,16 +104,16 @@ Since version 4.3 the driver support acquiring a list of known hosts in a cluste Since version 4.3 the driver supports load balancing for cluster setups in two different ways. -The first one is a round robin load balancing where the driver iterates through a list of known hosts and performs every request on a different host than the request before. This load balancing strategy only work when the maximun of connections is greater 1. +The first one is a round robin load balancing where the driver iterates through a list of known hosts and performs every request on a different host than the request before. ```Java - ArangoDB arangoDB = new ArangoDB.Builder().loadBalancingStrategy(LoadBalancingStrategy.ROUND_ROBIN).maxConnections(8).build(); + ArangoDB arangoDB = new ArangoDB.Builder().loadBalancingStrategy(LoadBalancingStrategy.ROUND_ROBIN).build(); ``` Just like the Fallback hosts feature the round robin load balancing strategy can use the `acquireHostList` configuration to acquire a list of all known hosts in the cluster. Do so only requires the manually configuration of only one host. Because this list is updated frequently it makes load balancing over the whole cluster very comfortable. ```Java - ArangoDB arangoDB = new ArangoDB.Builder().loadBalancingStrategy(LoadBalancingStrategy.ROUND_ROBIN).maxConnections(8).acquireHostList(true).build(); + ArangoDB arangoDB = new ArangoDB.Builder().loadBalancingStrategy(LoadBalancingStrategy.ROUND_ROBIN).acquireHostList(true).build(); ``` The second load balancing strategy allows to pick a random host from the configured or acquired list of hosts and sticks to that host as long as the connection is open. This strategy is useful for an application - using the driver - which provides a session management where each session has its own instance of `ArangoDB` build from a global configured list of hosts. In this case it could be wanted that every sessions sticks with all its requests to the same host but not all sessions should use the same host. This load balancing strategy also works together with `acquireHostList`. @@ -124,7 +124,7 @@ The second load balancing strategy allows to pick a random host from the configu ## Connection time to live -Since version 4.4 the driver supports setting a TTL for connections managed by the internal connection pool. Setting a TTL helps when using load balancing strategy `ROUND_ROBIN`, because as soon as a coordinator goes down, every open connection to that host will be closed and opened again with another target coordinator. As long as the driver does not have to open new connections (all connections in the pool are used) it will use only the coordinators which never went down. To use the downed coordinator again, when it is running again, the connections in the connection pool have to be closed and opened again with the target host mentioned by the load balancing strategy. To achieve this you can manually call `ArangoDB.shutdown` in your client code or use the TTL for connection so that a downed coordinator (which is then brought up again) will be used again after a certain time. +Since version 4.4 the driver supports setting a TTL for connections managed by the internal connection pool. ```Java ArangoDB arango = new ArangoDB.Builder().connectionTtl(5 * 60 * 1000).build(); diff --git a/Documentation/Books/Drivers/Java/Reference/View/ArangoSearch.md b/Documentation/Books/Drivers/Java/Reference/View/ArangoSearch.md index 7f52b92f71..f443897e3c 100644 --- a/Documentation/Books/Drivers/Java/Reference/View/ArangoSearch.md +++ b/Documentation/Books/Drivers/Java/Reference/View/ArangoSearch.md @@ -1,8 +1,8 @@ - + # ArangoSearch API These functions implement the -[HTTP API for ArangoSearch Views](../../../..//HTTP/Views/ArangoSearch.html). +[HTTP API for ArangoSearch views](../../../..//HTTP/Views/ArangoSearch.html). ## ArangoDatabase.createArangoSearch @@ -10,7 +10,7 @@ These functions implement the ArangoDatabase.createArangoSearch(String name, ArangoSearchCreateOptions options) : ViewEntity ``` -Creates a ArangoSearch View with the given _options_, then returns view information from the server. +Creates a ArangoSearch view with the given _options_, then returns view information from the server. **Arguments** @@ -20,11 +20,7 @@ Creates a ArangoSearch View with the given _options_, then returns view informat - **options**: `ArangoSearchCreateOptions` - - **locale**: `String` - - The default locale used for queries on analyzed string values (default: C). - - - **commitIntervalMsec**: `Long` + - **consolidationIntervalMsec**: `Long` Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, 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. @@ -32,17 +28,31 @@ Creates a ArangoSearch View with the given _options_, then returns view informat Wait at least this many commits between removing unused files in data directory (default: 10, 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. - - **threshold**: `ConsolidateThreshold[]` + - **consolidationPolicy**: - A list of consolidate thresholds + - **type**: `ConsolidationType` + + The type of the consolidation policy. + + - **threshold**: `Double` + + Select a given segment for "consolidation" if and only if the formula based on type (as defined above) evaluates to true, valid value range [0.0, 1.0] (default: 0.85) + + - **segmentThreshold**: `Long` + + Apply the "consolidation" operation if and only if (default: 300): {segmentThreshold} < number_of_segments + + - **link**: `CollectionLink[]` + + A list of linked collections **Examples** ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -db.createArangoSearch("potatoes", new ArangoSearchPropertiesOptions()); -// the ArangoSearch View "potatoes" now exists +db.createArangoSearch("potatos", new ArangoSearchPropertiesOptions()); +// the ArangoSearch view "potatos" now exists ``` ## ArangoSearch.create @@ -51,19 +61,15 @@ db.createArangoSearch("potatoes", new ArangoSearchPropertiesOptions()); ArangoSearch.create(ArangoSearchCreateOptions options) : ViewEntity ``` -Creates a ArangoSearch View with the given _options_, then returns view information from the server. +Creates a ArangoSearch view with the given _options_, then returns view information from the server. -Alternative for [ArangoDatabase.createArangoSearch](#arangodatabasecreatearangosearch). +Alternative for `ArangoDatabase.createArangoSearch`. **Arguments** - **options**: `ArangoSearchCreateOptions` - - **locale**: `String` - - The default locale used for queries on analyzed string values (default: C). - - - **commitIntervalMsec**: `Long` + - **consolidationIntervalMsec**: `Long` Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, 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. @@ -71,19 +77,33 @@ Alternative for [ArangoDatabase.createArangoSearch](#arangodatabasecreatearangos Wait at least this many commits between removing unused files in data directory (default: 10, 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. - - **threshold**: `ConsolidateThreshold[]` + - **consolidationPolicy**: - A list of consolidate thresholds + - **type**: `ConsolidationType` + + The type of the consolidation policy. + + - **threshold**: `Double` + + Select a given segment for "consolidation" if and only if the formula based on type (as defined above) evaluates to true, valid value range [0.0, 1.0] (default: 0.85) + + - **segmentThreshold**: `Long` + + Apply the "consolidation" operation if and only if (default: 300): {segmentThreshold} < number_of_segments + + - **link**: `CollectionLink[]` + + A list of linked collections **Examples** ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoSearch view = db.arangoSearch("potatoes"); +ArangoSearch view = db.arangoSearch("potatos"); view.create(new ArangoSearchPropertiesOptions()); -// the ArangoSearch View "potatoes" now exists +// the ArangoSearch view "potatos" now exists ``` ## ArangoSearch.getProperties @@ -99,7 +119,7 @@ Reads the properties of the specified view. ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoSearch view = db.arangoSearch("potatoes"); +ArangoSearch view = db.arangoSearch("potatos"); ArangoSearchPropertiesEntity properties = view.getProperties(); ``` @@ -116,11 +136,7 @@ Partially changes properties of the view. - **options**: `ArangoSearchPropertiesOptions` - - **locale**: `String` - - The default locale used for queries on analyzed string values (default: C). - - - **commitIntervalMsec**: `Long` + - **consolidationIntervalMsec**: `Long` Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, 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. @@ -128,13 +144,23 @@ Partially changes properties of the view. Wait at least this many commits between removing unused files in data directory (default: 10, 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. - - **threshold**: `ConsolidateThreshold[]` + - **consolidationPolicy**: - A list of consolidate thresholds + - **type**: `ConsolidationType` - - **link**: `CollectionLink[]` + The type of the consolidation policy. - A list of linked collections + - **threshold**: `Double` + + Select a given segment for "consolidation" if and only if the formula based on type (as defined above) evaluates to true, valid value range [0.0, 1.0] (default: 0.85) + + - **segmentThreshold**: `Long` + + Apply the "consolidation" operation if and only if (default: 300): {segmentThreshold} < number_of_segments + + - **link**: `CollectionLink[]` + + A list of linked collections **Examples** @@ -158,11 +184,7 @@ Changes properties of the view. - **options**: `ArangoSearchPropertiesOptions` - - **locale**: `String` - - The default locale used for queries on analyzed string values (default: C). - - - **commitIntervalMsec**: `Long` + - **consolidationIntervalMsec**: `Long` Wait at least this many milliseconds between committing index data changes and making them visible to queries (default: 60000, 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. @@ -170,13 +192,23 @@ Changes properties of the view. Wait at least this many commits between removing unused files in data directory (default: 10, 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. - - **threshold**: `ConsolidateThreshold[]` + - **consolidationPolicy**: - A list of consolidate thresholds + - **type**: `ConsolidationType` - - **link**: `CollectionLink[]` + The type of the consolidation policy. - A list of linked collections + - **threshold**: `Double` + + Select a given segment for "consolidation" if and only if the formula based on type (as defined above) evaluates to true, valid value range [0.0, 1.0] (default: 0.85) + + - **segmentThreshold**: `Long` + + Apply the "consolidation" operation if and only if (default: 300): {segmentThreshold} < number_of_segments + + - **link**: `CollectionLink[]` + + A list of linked collections **Examples** diff --git a/Documentation/Books/Drivers/Java/Reference/View/README.md b/Documentation/Books/Drivers/Java/Reference/View/README.md index 4ff8316d08..e91210855f 100644 --- a/Documentation/Books/Drivers/Java/Reference/View/README.md +++ b/Documentation/Books/Drivers/Java/Reference/View/README.md @@ -1,4 +1,4 @@ - + # View API These functions implement the @@ -23,7 +23,7 @@ Checks whether the view exists ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoView view = db.view("potatoes"); +ArangoView view = db.view("potatos"); boolean exists = view.exists(); ``` @@ -41,7 +41,7 @@ Returns information about the view. ```Java ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); -ArangoView view = db.view("potatoes"); +ArangoView view = db.view("potatos"); ViewEntity info = view.getInfo(); ``` diff --git a/Documentation/Books/Drivers/Java/Reference/View/ViewManipulation.md b/Documentation/Books/Drivers/Java/Reference/View/ViewManipulation.md index 627ed7a1b7..3a3f93610a 100644 --- a/Documentation/Books/Drivers/Java/Reference/View/ViewManipulation.md +++ b/Documentation/Books/Drivers/Java/Reference/View/ViewManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating the view These functions implement @@ -28,7 +28,7 @@ Creates a view of the given _type_, then returns view information from the serve ArangoDB arango = new ArangoDB.Builder().build(); ArangoDatabase db = arango.db("myDB"); db.createView("myView", ViewType.ARANGO_SEARCH); -// the view "potatoes" now exists +// the view "potatos" now exists ``` ## ArangoView.rename diff --git a/Documentation/Books/Drivers/PHP/GettingStarted/README.md b/Documentation/Books/Drivers/PHP/GettingStarted/README.md index 18a8357540..5c00b2a7ad 100644 --- a/Documentation/Books/Drivers/PHP/GettingStarted/README.md +++ b/Documentation/Books/Drivers/PHP/GettingStarted/README.md @@ -1,4 +1,4 @@ - + # ArangoDB-PHP - Getting Started ## Description diff --git a/Documentation/Books/Drivers/PHP/README.md b/Documentation/Books/Drivers/PHP/README.md index a99a89b612..967e1a58e7 100644 --- a/Documentation/Books/Drivers/PHP/README.md +++ b/Documentation/Books/Drivers/PHP/README.md @@ -1,4 +1,4 @@ - + # ArangoDB-PHP - A PHP client for ArangoDB The official ArangoDB PHP Driver. diff --git a/Documentation/Books/Drivers/PHP/Tutorial/README.md b/Documentation/Books/Drivers/PHP/Tutorial/README.md index 0a47d7dcf6..c69bfb5a18 100644 --- a/Documentation/Books/Drivers/PHP/Tutorial/README.md +++ b/Documentation/Books/Drivers/PHP/Tutorial/README.md @@ -1,4 +1,4 @@ - + # ArangoDB-PHP - Tutorial ## Setting up the connection options diff --git a/Documentation/Books/Drivers/SUMMARY.md b/Documentation/Books/Drivers/SUMMARY.md index 08926750c1..7b0c28fcca 100644 --- a/Documentation/Books/Drivers/SUMMARY.md +++ b/Documentation/Books/Drivers/SUMMARY.md @@ -5,7 +5,7 @@ ## Official Drivers -# https://@github.com/arangodb/arangodb-java-driver.git;arangodb-java-driver;docs/Drivers;;/ + * [Java Driver](Java/README.md) * [Getting Started](Java/GettingStarted/README.md) * [Reference](Java/Reference/README.md) @@ -35,7 +35,7 @@ * [Edges Manipulation](Java/Reference/Graph/Edges.md) * [Route](Java/Reference/Route.md) * [Serialization](Java/Reference/Serialization.md) -# https://@github.com/arangodb/arangodbjs.git;arangodbjs;docs/Drivers;;/ + * [ArangoJS - JavaScript Driver](JS/README.md) * [Getting Started](JS/GettingStarted/README.md) * [Reference](JS/Reference/README.md) @@ -65,11 +65,11 @@ * [VertexCollection](JS/Reference/Graph/VertexCollection.md) * [EdgeCollection](JS/Reference/Graph/EdgeCollection.md) * [Route](JS/Reference/Route.md) -# https://@github.com/arangodb/arangodb-php.git;arangodb-php;docs/Drivers;;/ + * [ArangoDB-PHP](PHP/README.md) * [Getting Started](PHP/GettingStarted/README.md) * [Tutorial](PHP/Tutorial/README.md) -# https://@github.com/arangodb/go-driver.git;go-driver;docs/Drivers;;/ + * [ArangoDB Go Driver](GO/README.md) * [Getting Started](GO/GettingStarted/README.md) * [Example Requests](GO/ExampleRequests/README.md) @@ -77,7 +77,7 @@ ## Integrations -# https://@github.com/arangodb/spring-data.git;spring-data;docs/Drivers;;/ + * [Spring Data ArangoDB](SpringData/README.md) * [Getting Started](SpringData/GettingStarted/README.md) * [Reference](SpringData/Reference/README.md) @@ -102,13 +102,14 @@ * [Indexes](SpringData/Reference/Mapping/Indexes.md) * [Converter](SpringData/Reference/Mapping/Converter.md) * [Events](SpringData/Reference/Mapping/Events.md) + * [Auditing](SpringData/Reference/Mapping/Auditing.md) * [Migration](SpringData/Migration/README.md) * [Migrating 1.x to 3.0](SpringData/Migration/Migrating-1.x-3.0.md) * [Migrating 2.x to 3.0](SpringData/Migration/Migrating-2.x-3.0.md) - -# https://@github.com/arangodb/arangodb-spark-connector.git;arangodb-spark-connector;docs/Drivers;;/ + * [ArangoDB Spark Connector](SparkConnector/README.md) * [Getting Started](SparkConnector/GettingStarted/README.md) * [Reference](SparkConnector/Reference/README.md) * [Java](SparkConnector/Reference/Java.md) * [Scala](SparkConnector/Reference/Scala.md) + diff --git a/Documentation/Books/Drivers/SparkConnector/GettingStarted/README.md b/Documentation/Books/Drivers/SparkConnector/GettingStarted/README.md index 4ae00ec792..36e819583f 100644 --- a/Documentation/Books/Drivers/SparkConnector/GettingStarted/README.md +++ b/Documentation/Books/Drivers/SparkConnector/GettingStarted/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Spark Connector - Getting Started ## Maven @@ -27,6 +27,7 @@ libraryDependencies += "com.arangodb" % "arangodb-spark-connector" % "1.0.2" | arangodb.hosts | comma separated list of ArangoDB hosts | 127.0.0.1:8529 | | arangodb.user | basic authentication user | root | | arangodb.password | basic authentication password | | +| arangodb.protocol | network protocol | VST | | arangodb.useSsl | use SSL connection | false | | arangodb.ssl.keyStoreFile | SSL certificate keystore file | | | arangodb.ssl.passPhrase | SSL pass phrase | | diff --git a/Documentation/Books/Drivers/SparkConnector/README.md b/Documentation/Books/Drivers/SparkConnector/README.md index f71a4aba05..74af7cdb4f 100644 --- a/Documentation/Books/Drivers/SparkConnector/README.md +++ b/Documentation/Books/Drivers/SparkConnector/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Spark Connector - [Getting Started](GettingStarted/README.md) diff --git a/Documentation/Books/Drivers/SparkConnector/Reference/Java.md b/Documentation/Books/Drivers/SparkConnector/Reference/Java.md index 2eeabe94ba..5d95b60485 100644 --- a/Documentation/Books/Drivers/SparkConnector/Reference/Java.md +++ b/Documentation/Books/Drivers/SparkConnector/Reference/Java.md @@ -1,4 +1,4 @@ - + # ArangoDB Spark Connector - Java Reference ## ArangoSpark.save diff --git a/Documentation/Books/Drivers/SparkConnector/Reference/README.md b/Documentation/Books/Drivers/SparkConnector/Reference/README.md index d4255d9fa3..83c7c03256 100644 --- a/Documentation/Books/Drivers/SparkConnector/Reference/README.md +++ b/Documentation/Books/Drivers/SparkConnector/Reference/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Spark Connector - Reference - [Scala](Scala.md) diff --git a/Documentation/Books/Drivers/SparkConnector/Reference/Scala.md b/Documentation/Books/Drivers/SparkConnector/Reference/Scala.md index af5e23cb5f..6f7816a833 100644 --- a/Documentation/Books/Drivers/SparkConnector/Reference/Scala.md +++ b/Documentation/Books/Drivers/SparkConnector/Reference/Scala.md @@ -1,4 +1,4 @@ - + # ArangoDB Spark Connector - Scala Reference ## ArangoSpark.save diff --git a/Documentation/Books/Drivers/SpringData/GettingStarted/README.md b/Documentation/Books/Drivers/SpringData/GettingStarted/README.md index 3c3c733155..7bbc79dd05 100644 --- a/Documentation/Books/Drivers/SpringData/GettingStarted/README.md +++ b/Documentation/Books/Drivers/SpringData/GettingStarted/README.md @@ -1,4 +1,4 @@ - + # Spring Data ArangoDB - Getting Started ## Supported versions @@ -24,7 +24,7 @@ To use Spring Data ArangoDB in your project, your build automation tool needs to com.arangodb arangodb-spring-data - 2.3.1 + 3.1.0 ``` diff --git a/Documentation/Books/Drivers/SpringData/Migration/Migrating-1.x-3.0.md b/Documentation/Books/Drivers/SpringData/Migration/Migrating-1.x-3.0.md index 59e38316f9..e571f44bc9 100644 --- a/Documentation/Books/Drivers/SpringData/Migration/Migrating-1.x-3.0.md +++ b/Documentation/Books/Drivers/SpringData/Migration/Migrating-1.x-3.0.md @@ -1,4 +1,4 @@ - -# Migrating Spring Data ArangoDB 2.x to 3.0 + +# Migrating Spring Data ArangoDB 1.x to 3.0 see [Migrating 2.x to 3.0](Migrating-2.x-3.0.md) diff --git a/Documentation/Books/Drivers/SpringData/Migration/Migrating-2.x-3.0.md b/Documentation/Books/Drivers/SpringData/Migration/Migrating-2.x-3.0.md index f10c3ebe83..2b99f88a45 100644 --- a/Documentation/Books/Drivers/SpringData/Migration/Migrating-2.x-3.0.md +++ b/Documentation/Books/Drivers/SpringData/Migration/Migrating-2.x-3.0.md @@ -1,4 +1,4 @@ - + # Migrating Spring Data ArangoDB 2.x to 3.0 ## Annotations @Key diff --git a/Documentation/Books/Drivers/SpringData/Migration/README.md b/Documentation/Books/Drivers/SpringData/Migration/README.md index 7aac7260b8..5e036a2726 100644 --- a/Documentation/Books/Drivers/SpringData/Migration/README.md +++ b/Documentation/Books/Drivers/SpringData/Migration/README.md @@ -1,4 +1,4 @@ - + # Spring Data ArangoDB - Migration - [Migrating 1.x to 3.0](Migrating-1.x-3.0.md) diff --git a/Documentation/Books/Drivers/SpringData/README.md b/Documentation/Books/Drivers/SpringData/README.md index c782f3310b..8c02250919 100644 --- a/Documentation/Books/Drivers/SpringData/README.md +++ b/Documentation/Books/Drivers/SpringData/README.md @@ -1,4 +1,4 @@ - + # Spring Data ArangoDB - [Getting Started](GettingStarted/README.md) diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Auditing.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Auditing.md new file mode 100644 index 0000000000..efafff0409 --- /dev/null +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Auditing.md @@ -0,0 +1,78 @@ + +# Auditing + +Since version 3.0.0 Spring Data ArangoDB provides basic auditing functionallity where you can track who made changes on your data and when. + +To enable auditing you have to add the annotation `@EnableArangoAuditing` to your configuration class. + +```Java +@Configuration +@EnableArangoAuditing +public class MyConfiguration extends AbstractArangoConfiguration { +``` + +We can now add fields to our model classes and annotade them with `@CreateDate`, `@CreatedBy`, `@LastModifiedDate` and `@LastModifiedBy` to store the auditing information. All annotation names should be self-explanatory. + +```Java +@Document +public class MyEntity { + + @CreatedDate + private Instant created; + + @CreatedBy + private User createdBy; + + @LastModifiedDate + private Instant modified; + + @LastModifiedBy + private User modifiedBy; + +} +``` + +The annotations `@CreateDate` and `@LastModifiedDate` are working with fields of any kind of Date/Timestamp type which is supported by Spring Data. (i.e. `java.util.Date`, `java.time.Instant`, `java.time.LocalDateTime`). + +For `@CreatedBy` and `@LastModifiedBy` we need to provide Spring Data the information of the current auditor (i.e. `User` in our case). We can do so by implementing the `AuditorAware` interface + +```Java +public class AuditorProvider implements AuditorAware { + @Override + public Optional getCurrentAuditor() { + // return current user + } +} +``` + +and add the implementation as a bean to our Spring context. + +```Java +@Configuration +@EnableArangoAuditing(auditorAwareRef = "auditorProvider") +public class MyConfiguration extends AbstractArangoConfiguration { + + @Bean + public AuditorAware auditorProvider() { + return new AuditorProvider(); + } + +} +``` + +If you use a type in your `AuditorAware` implementation, which will be also persisted in your database and you only want to save a reference in your entity, just add the [@Ref annotation](Reference.md) to the fields annotated with `@CreatedBy` and `@LastModifiedBy`. Keep in mind that you have to save the `User` in your database first to get a valid reference. + +```Java +@Document +public class MyEntity { + + @Ref + @CreatedBy + private User createdBy; + + @Ref + @LastModifiedBy + private User modifiedBy; + +} +``` diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Converter.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Converter.md index d366db8eda..5e951dd2e1 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Converter.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Converter.md @@ -1,4 +1,4 @@ - + # Converter ## Registering a Spring Converter diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Document.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Document.md index e34d59063b..020f60ae35 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Document.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Document.md @@ -1,4 +1,4 @@ - + # Document ## Annotation @Document diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Edge.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Edge.md index e7ead89857..f5b8453c9f 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Edge.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Edge.md @@ -1,4 +1,4 @@ - + # Edge ## Annotation @Edge diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Events.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Events.md index 023ef26b4e..eb78546849 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Events.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Events.md @@ -1,4 +1,4 @@ - + # Events Spring Data ArangoDB includes several `ApplicationEvent` events that your application can respond to by registering subclasses of `AbstractArangoEventListener` in the ApplicationContext. diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Indexes.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Indexes.md index 6273d0b58b..5f17058d96 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Indexes.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Indexes.md @@ -1,4 +1,4 @@ - + # Indexes ## Annotation @\Indexed diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/README.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/README.md index 2d203c8098..6e4dae3020 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/README.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/README.md @@ -1,4 +1,4 @@ - + # Mapping In this section we will describe the features and conventions for mapping Java objects to documents and how to override those conventions with annotation based mapping metadata. diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Reference.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Reference.md index 08bb5432ad..37e1e1b844 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Reference.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Reference.md @@ -1,4 +1,4 @@ - + # Reference With the annotation `@Ref` applied on a field the nested object isn’t stored as a nested object in the document. The `_id` field of the nested object is stored in the document and the nested object has to be stored as a separate document in another collection described in the `@Document` annotation of the nested object class. To successfully persist an instance of your object the referencing field has to be null or it's instance has to provide a field with the annotation `@Id` including a valid id. diff --git a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Relations.md b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Relations.md index c4eca63cdd..f9eae9b7a2 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Mapping/Relations.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Mapping/Relations.md @@ -1,4 +1,4 @@ - + # Relations With the annotation `@Relations` applied on a collection or array field in a class annotated with `@Document` the nested objects are fetched from the database over a graph traversal with your current object as the starting point. The most relevant parameter is `edge`. With `edge` you define the edge collection - which should be used in the traversal - using the class type. With the parameter `depth` you can define the maximal depth for the traversal (default 1) and the parameter `direction` defines whether the traversal should follow outgoing or incoming edges (default Direction.ANY). diff --git a/Documentation/Books/Drivers/SpringData/Reference/README.md b/Documentation/Books/Drivers/SpringData/Reference/README.md index 95b997c26a..03306fb5bf 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/README.md +++ b/Documentation/Books/Drivers/SpringData/Reference/README.md @@ -1,4 +1,4 @@ - + # Spring Data ArangoDB - Reference - [Template](Template/README.md) @@ -22,3 +22,4 @@ - [Indexes](Mapping/Indexes.md) - [Converter](Mapping/Converter.md) - [Events](Mapping/Events.md) + - [Auditing](Mapping/Auditing.md) diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/DocumentManipulation.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/DocumentManipulation.md index f6932a03aa..b3f97cc004 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/DocumentManipulation.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/DocumentManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating documents ## ArangoRepository.existsById diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/MultiDocumentManipulation.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/MultiDocumentManipulation.md index d2090913d0..36f1717b2e 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/MultiDocumentManipulation.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/MultiDocumentManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating multiple documents ## ArangoRepository.findAll diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/DerivedQueries.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/DerivedQueries.md index df1bdb5744..fa16da5b85 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/DerivedQueries.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/DerivedQueries.md @@ -1,4 +1,4 @@ - + # Derived queries ## Semantic parts diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/NamedQueries.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/NamedQueries.md index adbb22af04..7e45cf0798 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/NamedQueries.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/NamedQueries.md @@ -1,4 +1,4 @@ - + # Named queries An alternative to using the `@Query` annotation on methods is specifying them in a separate `.properties` file. The default path for the file is `META-INF/arango-named-queries.properties` and can be changed with the `EnableArangoRepositories#namedQueriesLocation()` setting. The entries in the properties file must adhere to the following convention: `{simple entity name}.{method name} = {query}`. Let's assume we have the following repository interface: diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/QueryMethods.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/QueryMethods.md index 701fd3d9e9..ffa111b737 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/QueryMethods.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/QueryMethods.md @@ -1,4 +1,4 @@ - + # Query methods Queries using [ArangoDB Query Language (AQL)](https://docs.arangodb.com/current/AQL/index.html) can be supplied with the `@Query` annotation on methods. diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/README.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/README.md index 8d31e2f55b..f60125ba7e 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/README.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/Queries/README.md @@ -1,4 +1,4 @@ - + # Queries Spring Data ArangoDB supports three kinds of queries: diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/QueryByExample.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/QueryByExample.md index 1983f781ef..7ab142dddd 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/QueryByExample.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/QueryByExample.md @@ -1,4 +1,4 @@ - + # Query by example ## ArangoRepository.exists diff --git a/Documentation/Books/Drivers/SpringData/Reference/Repositories/README.md b/Documentation/Books/Drivers/SpringData/Reference/Repositories/README.md index 2ee9b0ad1f..6ea7ab39f1 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Repositories/README.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Repositories/README.md @@ -1,4 +1,4 @@ - + # Repositories Spring Data Commons provides a composable repository infrastructure which Spring Data ArangoDB is built on. These allow for interface-based composition of repositories consisting of provided default implementations for certain interfaces (like `CrudRepository`) and custom implementations for other methods. diff --git a/Documentation/Books/Drivers/SpringData/Reference/Template/CollectionManipulation.md b/Documentation/Books/Drivers/SpringData/Reference/Template/CollectionManipulation.md index 8a80b8bc26..96e4afecce 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Template/CollectionManipulation.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Template/CollectionManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating the collection ## ArangoOperations.collection diff --git a/Documentation/Books/Drivers/SpringData/Reference/Template/DocumentManipulation.md b/Documentation/Books/Drivers/SpringData/Reference/Template/DocumentManipulation.md index ca88097f57..7bd87d5cf3 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Template/DocumentManipulation.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Template/DocumentManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating documents ## ArangoOperations.exists diff --git a/Documentation/Books/Drivers/SpringData/Reference/Template/MultiDocumentManipulation.md b/Documentation/Books/Drivers/SpringData/Reference/Template/MultiDocumentManipulation.md index ca7dc95e4b..c67ed706aa 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Template/MultiDocumentManipulation.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Template/MultiDocumentManipulation.md @@ -1,4 +1,4 @@ - + # Manipulating multiple documents ## ArangoOperations.find diff --git a/Documentation/Books/Drivers/SpringData/Reference/Template/Queries.md b/Documentation/Books/Drivers/SpringData/Reference/Template/Queries.md index e981f20a01..fcc3230031 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Template/Queries.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Template/Queries.md @@ -1,4 +1,4 @@ - + ## ArangoOperations.query ``` @@ -73,7 +73,7 @@ Performs a database query using the given _query_ and _bindVars_, then returns a - **fullCount**: `Boolean` - 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. + 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 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 will only be present in the result if the query has a LIMIT clause and the LIMIT clause is actually used in the query. - **maxPlans**: `Integer` diff --git a/Documentation/Books/Drivers/SpringData/Reference/Template/README.md b/Documentation/Books/Drivers/SpringData/Reference/Template/README.md index 8f6fa623a2..6d24ed1f74 100644 --- a/Documentation/Books/Drivers/SpringData/Reference/Template/README.md +++ b/Documentation/Books/Drivers/SpringData/Reference/Template/README.md @@ -1,4 +1,4 @@ - + # Template With `ArangoTemplate` Spring Data ArangoDB offers a central support for interactions with the database over a rich feature set. It mostly offers the features from the ArangoDB Java driver with additional exception translation from the drivers exceptions to the Spring Data access exceptions inheriting the `DataAccessException` class. diff --git a/Documentation/Books/Manual/Administration/DC2DC/README.md b/Documentation/Books/Manual/Administration/DC2DC/README.md index 39deda5830..66cba25274 100644 --- a/Documentation/Books/Manual/Administration/DC2DC/README.md +++ b/Documentation/Books/Manual/Administration/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Datacenter to datacenter replication administration {% hint 'info' %} @@ -104,10 +104,20 @@ arangosync stop sync \ --auth.password= ``` -The command will wait until synchronization has completely stopped before returning. +The command will first ensure that all shards in the receiving cluster are +completely in-sync with the shards in the sending cluster. +In order to achieve that, the sending cluster will be switched to read/only mode. +After the synchronization has stopped, the sending cluster will be switched +back to read/write mode. + +The command will then wait until synchronization has completely stopped before returning. If the synchronization is not completely stopped within a reasonable period (2 minutes by default) the command will fail. +If you do not want to wait for all shards in the receiving cluster to be +completely in-sync with the shards in the sending cluster, add an `--ensure-in-sync=false` +argument to the `stop sync` command. + If the source datacenter is no longer available it is not possible to stop synchronization in a graceful manner. If that happens abort the synchronization with the following command: diff --git a/Documentation/Books/Manual/Administration/Starter/README.md b/Documentation/Books/Manual/Administration/Starter/README.md index 8f31a7a42a..ba29c69d32 100644 --- a/Documentation/Books/Manual/Administration/Starter/README.md +++ b/Documentation/Books/Manual/Administration/Starter/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Starter Administration This chapter documents administering the _ArangoDB Starter_. diff --git a/Documentation/Books/Manual/Administration/Starter/Recovery.md b/Documentation/Books/Manual/Administration/Starter/Recovery.md index 1a44fcf78e..3f22888e36 100644 --- a/Documentation/Books/Manual/Administration/Starter/Recovery.md +++ b/Documentation/Books/Manual/Administration/Starter/Recovery.md @@ -1,4 +1,4 @@ - + # ArangoDB Starter Recovery Procedure This procedure is intended to recover a cluster (that was started with the ArangoDB diff --git a/Documentation/Books/Manual/Administration/Starter/Removal.md b/Documentation/Books/Manual/Administration/Starter/Removal.md index 672322952b..1c612a329b 100644 --- a/Documentation/Books/Manual/Administration/Starter/Removal.md +++ b/Documentation/Books/Manual/Administration/Starter/Removal.md @@ -1,4 +1,4 @@ - + # ArangoDB Starter Removal Procedure This procedure is intended to remove a machine from a cluster diff --git a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Applicability.md b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Applicability.md index bdca383836..30d9db012f 100644 --- a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Applicability.md +++ b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Applicability.md @@ -1,4 +1,4 @@ - + # When to use it... and when not The _datacenter to datacenter replication_ is a good solution in all cases where diff --git a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Introduction.md b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Introduction.md index 81e568f5c9..3f909bb856 100644 --- a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Introduction.md +++ b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Introduction.md @@ -1,4 +1,4 @@ - + # Introduction At some point in the grows of a database, there comes a need for replicating it diff --git a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Limitations.md b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Limitations.md index f605b71429..c733da4771 100644 --- a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Limitations.md +++ b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Limitations.md @@ -1,4 +1,4 @@ - + Limitations =========== diff --git a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/README.md b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/README.md index eb58d2b726..ccecfcb843 100644 --- a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/README.md +++ b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Datacenter to datacenter replication {% hint 'info' %} diff --git a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Requirements.md b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Requirements.md index 66852c6448..0ab4e49632 100644 --- a/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Requirements.md +++ b/Documentation/Books/Manual/Architecture/DeploymentModes/DC2DC/Requirements.md @@ -1,9 +1,10 @@ - + # Requirements To use _datacenter to datacenter replication_ you need the following: -- Two datacenters, each running an ArangoDB Enterprise Edition cluster, version 3.3 or higher. +- Two datacenters, each running an ArangoDB Enterprise Edition cluster, + version 3.3 or higher, using the RocksDB storage engine. - A network connection between both datacenters with accessible endpoints for several components (see individual components for details). - TLS certificates for ArangoSync master instances (can be self-signed). diff --git a/Documentation/Books/Manual/Deployment/ActiveFailover/UsingTheStarter.md b/Documentation/Books/Manual/Deployment/ActiveFailover/UsingTheStarter.md index 67ca12e4bf..ae8a47d19c 100644 --- a/Documentation/Books/Manual/Deployment/ActiveFailover/UsingTheStarter.md +++ b/Documentation/Books/Manual/Deployment/ActiveFailover/UsingTheStarter.md @@ -1,4 +1,4 @@ - + Using the ArangoDB Starter ========================== diff --git a/Documentation/Books/Manual/Deployment/ArangoDBStarter/README.md b/Documentation/Books/Manual/Deployment/ArangoDBStarter/README.md index 9109df465b..516e2802c5 100644 --- a/Documentation/Books/Manual/Deployment/ArangoDBStarter/README.md +++ b/Documentation/Books/Manual/Deployment/ArangoDBStarter/README.md @@ -1,4 +1,4 @@ - + Deploying using the ArangoDB Starter ==================================== diff --git a/Documentation/Books/Manual/Deployment/Cluster/UsingTheStarter.md b/Documentation/Books/Manual/Deployment/Cluster/UsingTheStarter.md index b006a9d772..bfeb64a054 100644 --- a/Documentation/Books/Manual/Deployment/Cluster/UsingTheStarter.md +++ b/Documentation/Books/Manual/Deployment/Cluster/UsingTheStarter.md @@ -1,4 +1,4 @@ - + Using the ArangoDB Starter ========================== diff --git a/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncMaster.md b/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncMaster.md index 7e06be9d95..ed26aaab34 100644 --- a/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncMaster.md +++ b/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncMaster.md @@ -1,4 +1,4 @@ - + # ArangoSync Master The _ArangoSync Master_ is responsible for managing all synchronization, creating diff --git a/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncWorkers.md b/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncWorkers.md index b12f60083d..bcb7e70f01 100644 --- a/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncWorkers.md +++ b/Documentation/Books/Manual/Deployment/DC2DC/ArangoSyncWorkers.md @@ -1,4 +1,4 @@ - + # ArangoSync Workers The _ArangoSync Worker_ is responsible for executing synchronization tasks. diff --git a/Documentation/Books/Manual/Deployment/DC2DC/Cluster.md b/Documentation/Books/Manual/Deployment/DC2DC/Cluster.md index a089df5dc2..e59928975d 100644 --- a/Documentation/Books/Manual/Deployment/DC2DC/Cluster.md +++ b/Documentation/Books/Manual/Deployment/DC2DC/Cluster.md @@ -1,4 +1,4 @@ - + # ArangoDB cluster There are several ways to start an ArangoDB cluster. In this section we will focus diff --git a/Documentation/Books/Manual/Deployment/DC2DC/KafkaZookeeper.md b/Documentation/Books/Manual/Deployment/DC2DC/KafkaZookeeper.md index d2a7dbbe5b..43746ad89f 100644 --- a/Documentation/Books/Manual/Deployment/DC2DC/KafkaZookeeper.md +++ b/Documentation/Books/Manual/Deployment/DC2DC/KafkaZookeeper.md @@ -1,4 +1,4 @@ - + # Kafka & Zookeeper - How to deploy Zookeeper diff --git a/Documentation/Books/Manual/Deployment/DC2DC/PrometheusGrafana.md b/Documentation/Books/Manual/Deployment/DC2DC/PrometheusGrafana.md index 6461d84cc3..8a25f45009 100644 --- a/Documentation/Books/Manual/Deployment/DC2DC/PrometheusGrafana.md +++ b/Documentation/Books/Manual/Deployment/DC2DC/PrometheusGrafana.md @@ -1,4 +1,4 @@ - + # Prometheus & Grafana (optional) _ArangoSync_ provides metrics in a format supported by [Prometheus](https://prometheus.io). diff --git a/Documentation/Books/Manual/Deployment/DC2DC/README.md b/Documentation/Books/Manual/Deployment/DC2DC/README.md index 92035d60ee..36d8847b89 100644 --- a/Documentation/Books/Manual/Deployment/DC2DC/README.md +++ b/Documentation/Books/Manual/Deployment/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Datacenter to datacenter replication deployment {% hint 'info' %} diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Authentication.md b/Documentation/Books/Manual/Deployment/Kubernetes/Authentication.md index 1dd4bbc58d..75ea59bef6 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Authentication.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Authentication.md @@ -1,4 +1,4 @@ - + # Authentication The ArangoDB Kubernetes Operator will by default create ArangoDB deployments diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/ConfigAndSecrets.md b/Documentation/Books/Manual/Deployment/Kubernetes/ConfigAndSecrets.md index a7ff858d51..7f57e56d66 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/ConfigAndSecrets.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/ConfigAndSecrets.md @@ -1,4 +1,4 @@ - + # Configuration & secrets An ArangoDB cluster has lots of configuration options. diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Dashboards.md b/Documentation/Books/Manual/Deployment/Kubernetes/Dashboards.md new file mode 100644 index 0000000000..09da64d322 --- /dev/null +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Dashboards.md @@ -0,0 +1,74 @@ + +# Operator Dashboards + +The ArangoDB Kubernetes Operator can create a dashboard for each type of +resource it supports. These dashboards are intended to give an overview of +the created resources, their state and instructions on how to modify those resources. + +The dashboards do not provide direct means to modify the resources. +All modifications are done using `kubectl` commands (which are provided by the dashboards) +so the standard security of your Kubernetes cluster is not bypassed. + +## Exposing the dashboards + +For each resource type (deployment, deployment replication & local storage) operator +a `Service` is created that serves the dashboard internally in the Kubernetes cluster. +To expose a dashboard outside the Kubernetes cluster, run a `kubecty expose` +command like this: + +```bash +kubectl expose service --type=LoadBalancer \ + --port=8528 --target-port=8528 \ + --name= --namespace= +``` + +Replace `` with: + +- `arango-deployment-operator` for the ArangoDeployment operator dashboard. +- `arango-deployment-replication-operator` for the ArangoDeploymentReplication + operator dashboard. +- `arango-storage-operator` for the ArangoLocalStorage operator dashboard. + (use 'kube-system' namespace) + +Replace `` with the name of the namespace that the operator is in. +This will often be `default`. + +This will create an additional `Service` of type `LoadBalancer` that copies +the selector from the existing `Service`. +If your Kubernetes cluster does not support loadbalancers, +use `--type=NodePort` instead. + +Run the following command to inspect your new service and look for the +loadbalancer IP/host address (or nodeport). + +```bash +kubectl get service --namespace= +``` + +This will result in something like this: + +```bash +$ kubectl get service arango-storage-operator-lb --namespace=kube-system +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +arango-storage-operator-lb LoadBalancer 10.103.30.24 192.168.31.11 8528:30655/TCP 1d +``` + +## Authentication + +While the dashboards do not provide any means to directly modify resources, +they still show sensitive information (e.g. TLS certificates). +Therefore the dashboards require a username+password for authentications. + +The username+password pair is configured in a generic Kubernetes `Secret` named `arangodb-operator-dashboard`, found in the namespace where the operator runs. + +To create such a secret, run this: + +```bash +kubectl create secret generic \ + arangodb-operator-dashboard --namespace= \ + --from-literal=username= \ + --from-literal=password= +``` + +Until such a `Secret` is found, the operator will respond with a status `401` +to any request related to the dashboard. diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentReplicationResource.md b/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentReplicationResource.md index f1d1d8263f..e8f59f20f0 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentReplicationResource.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentReplicationResource.md @@ -1,4 +1,4 @@ - + # ArangoDeploymentReplication Custom Resource The ArangoDB Replication Operator creates and maintains ArangoDB diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentResource.md b/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentResource.md index 6759991f0d..479f82511d 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentResource.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/DeploymentResource.md @@ -1,4 +1,4 @@ - + # ArangoDeployment Custom Resource The ArangoDB Deployment Operator creates and maintains ArangoDB deployments diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/DriverConfiguration.md b/Documentation/Books/Manual/Deployment/Kubernetes/DriverConfiguration.md index d56cfec877..b498675bf2 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/DriverConfiguration.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/DriverConfiguration.md @@ -1,4 +1,4 @@ - + # Configuring your driver for ArangoDB access In this chapter you'll learn how to configure a driver for accessing diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Helm.md b/Documentation/Books/Manual/Deployment/Kubernetes/Helm.md new file mode 100644 index 0000000000..7bd93e2bb6 --- /dev/null +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Helm.md @@ -0,0 +1,92 @@ + +# Using the ArangoDB Kubernetes Operator with Helm + +[`Helm`](https://www.helm.sh/) is a package manager for Kubernetes, which enables +you to install various packages (include the ArangoDB Kubernetes Operator) +into your Kubernetes cluster. + +The benefit of `helm` (in the context of the ArangoDB Kubernetes Operator) +is that it allows for a lot of flexibility in how you install the operator. +For example you can install the operator in a namespace other than +`default`. + +## Charts + +The ArangoDB Kubernetes Operator is contained in two `helm` charts: + +- `kube-arangodb` which contains the operator for the `ArangoDeployment` + and `ArangoDeploymentReplication` resource types. +- `kube-arangodb-storage` which contains the operator for the `ArangoLocalStorage` + resource type. + +The `kube-arangodb-storage` only has to be installed if your Kubernetes cluster +does not already provide `StorageClasses` that use locally attached SSDs. + +## Configurable values for ArangoDB Kubernetes Operator + +The following values can be configured when installing the +ArangoDB Kubernetes Operator with `helm`. + +Values are passed to `helm` using an `--set==` argument passed +to the `helm install` or `helm upgrade` command. + +### Values applicable to both charts + +| Key | Type | Description +|-------------------|--------|-----| +| Image | string | Override the docker image used by the operators +| ImagePullPolicy | string | Override the image pull policy used by the operators. See [Updating Images](https://kubernetes.io/docs/concepts/containers/images/#updating-images) for details. +| RBAC.Create | bool | Set to `true` (default) to create roles & role bindings. + +### Values applicable to the `kube-arangodb` chart + +| Key | Type | Description +|-------------------|--------|-----| +| Deployment.Create | bool | Set to `true` (default) to deploy the `ArangoDeployment` operator +| Deployment.User.ServiceAccountName | string | Name of the `ServiceAccount` that is the subject of the `RoleBinding` of users of the `ArangoDeployment` operator +| Deployment.Operator.ServiceAccountName | string | Name of the `ServiceAccount` used to run the `ArangoDeployment` operator +| Deployment.Operator.ServiceType | string | Type of `Service` created for the dashboard of the `ArangoDeployment` operator +| Deployment.AllowChaos | bool | Set to `true` to allow the introduction of chaos. **Only use for testing, never for production!** Defaults to `false`. +| DeploymentReplication.Create | bool | Set to `true` (default) to deploy the `ArangoDeploymentReplication` operator +| DeploymentReplication.User.ServiceAccountName | string | Name of the `ServiceAccount` that is the subject of the `RoleBinding` of users of the `ArangoDeploymentReplication` operator +| DeploymentReplication.Operator.ServiceAccountName | string | Name of the `ServiceAccount` used to run the `ArangoDeploymentReplication` operator +| DeploymentReplication.Operator.ServiceType | string | Type of `Service` created for the dashboard of the `ArangoDeploymentReplication` operator + +### Values applicable to the `kube-arangodb-storage` chart + +| Key | Type | Description +|-------------------|--------|-----| +| Storage.User.ServiceAccountName | string | Name of the `ServiceAccount` that is the subject of the `RoleBinding` of users of the `ArangoLocalStorage` operator +| Storage.Operator.ServiceAccountName | string | Name of the `ServiceAccount` used to run the `ArangoLocalStorage` operator +| Storage.Operator.ServiceType | string | Type of `Service` created for the dashboard of the `ArangoLocalStorage` operator + +## Alternate namespaces + +The `kube-arangodb` chart supports deployment into a non-default namespace. + +To install the `kube-arangodb` chart is a non-default namespace, use the `--namespace` +argument like this. + +```bash +helm install --namespace=mynamespace kube-arangodb.tgz +``` + +Note that since the operators claim exclusive access to a namespace, you can +install the `kube-arangodb` chart in a namespace once. +You can install the `kube-arangodb` chart in multiple namespaces. To do so, run: + +```bash +helm install --namespace=namespace1 kube-arangodb.tgz +helm install --namespace=namespace2 kube-arangodb.tgz +``` + +The `kube-arangodb-storage` chart is always installed in the `kube-system` namespace. + +## Common problems + +### Error: no available release name found + +This error is given by `helm install ...` in some cases where it has +insufficient permissions to install charts. + +For various ways to work around this problem go to [this Stackoverflow article](https://stackoverflow.com/questions/43499971/helm-error-no-available-release-name-found). diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Metrics.md b/Documentation/Books/Manual/Deployment/Kubernetes/Metrics.md index 3aea330c14..7006f912d9 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Metrics.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Metrics.md @@ -1,4 +1,4 @@ - + # Metrics The ArangoDB Kubernetes Operator (`kube-arangodb`) exposes metrics of diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/README.md b/Documentation/Books/Manual/Deployment/Kubernetes/README.md index 78d79e4923..8dc94b5d50 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/README.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Kubernetes Operator The ArangoDB Kubernetes Operator (`kube-arangodb`) is a set of operators @@ -19,4 +19,4 @@ Each of these uses involves a different custom resource. Continue with [Using the ArangoDB Kubernetes Operator](./Usage.md) to learn how to install the ArangoDB Kubernetes operator and create -your first deployment. +your first deployment. \ No newline at end of file diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Scaling.md b/Documentation/Books/Manual/Deployment/Kubernetes/Scaling.md index a509879e03..c435a64290 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Scaling.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Scaling.md @@ -1,4 +1,4 @@ - + # Scaling The ArangoDB Kubernetes Operator supports up and down scaling of diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md b/Documentation/Books/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md index cd8b44ab9b..662c71796f 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md @@ -1,4 +1,4 @@ - + # Services and load balancer The ArangoDB Kubernetes Operator will create services that can be used to diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Storage.md b/Documentation/Books/Manual/Deployment/Kubernetes/Storage.md index 5d841f847d..448ac7a6f0 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Storage.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Storage.md @@ -1,4 +1,4 @@ - + # Storage An ArangoDB cluster relies heavily on fast persistent storage. diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/StorageResource.md b/Documentation/Books/Manual/Deployment/Kubernetes/StorageResource.md index 08eb00b320..e680ac40a0 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/StorageResource.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/StorageResource.md @@ -1,4 +1,4 @@ - + # ArangoLocalStorage Custom Resource The ArangoDB Storage Operator creates and maintains ArangoDB diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Tls.md b/Documentation/Books/Manual/Deployment/Kubernetes/Tls.md index 4f18eebcb8..05a9bf9e5c 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Tls.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Tls.md @@ -1,4 +1,4 @@ - + # Secure connections (TLS) The ArangoDB Kubernetes Operator will by default create ArangoDB deployments diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Troubleshooting.md b/Documentation/Books/Manual/Deployment/Kubernetes/Troubleshooting.md index c74da001e5..e384fad7f6 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Troubleshooting.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Troubleshooting.md @@ -1,4 +1,4 @@ - + # Troubleshooting While Kubernetes and the ArangoDB Kubernetes operator will automatically diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Upgrading.md b/Documentation/Books/Manual/Deployment/Kubernetes/Upgrading.md index 7f048520df..8f48a5e98e 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Upgrading.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Upgrading.md @@ -1,4 +1,4 @@ - + # Upgrading The ArangoDB Kubernetes Operator supports upgrading an ArangoDB from @@ -39,4 +39,4 @@ kubectl apply -f examples/yourUpdatedDeployment.yaml ## See also -- [Scaling](./Scaling.md) +- [Scaling](./Scaling.md) \ No newline at end of file diff --git a/Documentation/Books/Manual/Deployment/Kubernetes/Usage.md b/Documentation/Books/Manual/Deployment/Kubernetes/Usage.md index 52b660ee8a..0d51d87a80 100644 --- a/Documentation/Books/Manual/Deployment/Kubernetes/Usage.md +++ b/Documentation/Books/Manual/Deployment/Kubernetes/Usage.md @@ -1,4 +1,4 @@ - + # Using the ArangoDB Kubernetes Operator ## Installation @@ -6,11 +6,41 @@ The ArangoDB Kubernetes Operator needs to be installed in your Kubernetes cluster first. -To do so, run (replace `` with the version of the operator that you want to install): +If you have `Helm` available, we recommend installation using `Helm`. + +### Installation with Helm + +To install the ArangoDB Kubernetes Operator with [`helm`](https://www.helm.sh/), +run (replace `` with the version of the operator that you want to install): + +```bash +export URLPREFIX=https://github.com/arangodb/kube-arangodb/releases/download/ +helm install $URLPREFIX/kube-arangodb.tgz +``` + +This installs operators for the `ArangoDeployment` and `ArangoDeploymentReplication` +resource types. + +If you want to avoid the installation of the operator for the `ArangoDeploymentReplication` +resource type, add `--set=DeploymentReplication.Create=false` to the `helm install` +command. + +To use `ArangoLocalStorage` resources, also run: + +```bash +helm install $URLPREFIX/kube-arangodb-storage.tgz +``` + +For more information on installing with `Helm` and how to customize an installation, +see [Using the ArangoDB Kubernetes Operator with Helm](./Helm.md). + +### Installation with Kubectl + +To install the ArangoDB Kubernetes Operator without `Helm`, +run (replace `` with the version of the operator that you want to install): ```bash export URLPREFIX=https://raw.githubusercontent.com/arangodb/kube-arangodb//manifests -kubectl apply -f $URLPREFIX/crd.yaml kubectl apply -f $URLPREFIX/arango-deployment.yaml ``` @@ -61,6 +91,14 @@ If you want to keep your data, make sure to create a backup before removing the To remove the entire ArangoDB Kubernetes Operator, remove all clusters first and then remove the operator by running: +```bash +helm delete +# If `ArangoLocalStorage` operator is installed +helm delete +``` + +or when you used `kubectl` to install the operator, run: + ```bash kubectl delete deployment arango-deployment-operator # If `ArangoLocalStorage` operator is installed @@ -74,3 +112,4 @@ kubectl delete deployment arango-deployment-replication-operator - [Driver configuration](./DriverConfiguration.md) - [Scaling](./Scaling.md) - [Upgrading](./Upgrading.md) +- [Using the ArangoDB Kubernetes Operator with Helm](./Helm.md) \ No newline at end of file diff --git a/Documentation/Books/Manual/Deployment/SingleInstance/UsingTheStarter.md b/Documentation/Books/Manual/Deployment/SingleInstance/UsingTheStarter.md index e1fff576e5..1b1c9f56c5 100644 --- a/Documentation/Books/Manual/Deployment/SingleInstance/UsingTheStarter.md +++ b/Documentation/Books/Manual/Deployment/SingleInstance/UsingTheStarter.md @@ -1,4 +1,4 @@ - + Using the ArangoDB Starter ========================== diff --git a/Documentation/Books/Manual/Monitoring/DC2DC/README.md b/Documentation/Books/Manual/Monitoring/DC2DC/README.md index a03e65ee31..73bce37bc3 100644 --- a/Documentation/Books/Manual/Monitoring/DC2DC/README.md +++ b/Documentation/Books/Manual/Monitoring/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Monitoring datacenter to datacenter replication {% hint 'info' %} diff --git a/Documentation/Books/Manual/Programs/FoxxCLI/Details.md b/Documentation/Books/Manual/Programs/FoxxCLI/Details.md index 74492613d5..238e955916 100644 --- a/Documentation/Books/Manual/Programs/FoxxCLI/Details.md +++ b/Documentation/Books/Manual/Programs/FoxxCLI/Details.md @@ -1,4 +1,4 @@ - + # Foxx CLI Details ## Install diff --git a/Documentation/Books/Manual/Programs/FoxxCLI/README.md b/Documentation/Books/Manual/Programs/FoxxCLI/README.md index d6b867d606..b5e378bc50 100644 --- a/Documentation/Books/Manual/Programs/FoxxCLI/README.md +++ b/Documentation/Books/Manual/Programs/FoxxCLI/README.md @@ -1,4 +1,4 @@ - + # Foxx CLI Foxx CLI is command line tool for managing and developing ArangoDB diff --git a/Documentation/Books/Manual/Programs/Starter/Architecture.md b/Documentation/Books/Manual/Programs/Starter/Architecture.md index 5903057786..33526cabf7 100644 --- a/Documentation/Books/Manual/Programs/Starter/Architecture.md +++ b/Documentation/Books/Manual/Programs/Starter/Architecture.md @@ -1,4 +1,4 @@ - + # ArangoDB Starter Architecture ## What does the Starter do diff --git a/Documentation/Books/Manual/Programs/Starter/Options.md b/Documentation/Books/Manual/Programs/Starter/Options.md index 2099653c9f..cad4cd5cf6 100644 --- a/Documentation/Books/Manual/Programs/Starter/Options.md +++ b/Documentation/Books/Manual/Programs/Starter/Options.md @@ -1,4 +1,4 @@ - + # Option reference The ArangoDB Starter provides a lot of options to control various aspects diff --git a/Documentation/Books/Manual/Programs/Starter/README.md b/Documentation/Books/Manual/Programs/Starter/README.md index e1b393af78..4d31165520 100644 --- a/Documentation/Books/Manual/Programs/Starter/README.md +++ b/Documentation/Books/Manual/Programs/Starter/README.md @@ -1,4 +1,4 @@ - + # ArangoDB Starter This chapter documents the _ArangoDB Starter_. diff --git a/Documentation/Books/Manual/Programs/Starter/Security.md b/Documentation/Books/Manual/Programs/Starter/Security.md index 821f6c45cc..8fb3c6deae 100644 --- a/Documentation/Books/Manual/Programs/Starter/Security.md +++ b/Documentation/Books/Manual/Programs/Starter/Security.md @@ -1,4 +1,4 @@ - + # Security Securing an ArangoDB deployment involves encrypting its connections and diff --git a/Documentation/Books/Manual/SUMMARY.md b/Documentation/Books/Manual/SUMMARY.md index 1dbef8dace..fc51b3f379 100644 --- a/Documentation/Books/Manual/SUMMARY.md +++ b/Documentation/Books/Manual/SUMMARY.md @@ -15,12 +15,13 @@ * [Coming from SQL](GettingStarted/ComingFromSql.md) * [Next Steps](GettingStarted/NextSteps.md) * [Tutorials](Tutorials/README.md) -# https://@github.com/arangodb-helper/arangodb.git;arangodb;docs/Manual;;/ + * [ArangoDB Starter](Tutorials/Starter/README.md) -# https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Datacenter to datacenter Replication](Tutorials/DC2DC/README.md) -# https://@github.com/arangodb/kube-arangodb.git;kube-arangodb;docs/Manual;;/ + * [Kubernetes](Tutorials/Kubernetes/README.md) + * [GKE](Tutorials/Kubernetes/GKE.md) * [DC2DC on Kubernetes](Tutorials/Kubernetes/DC2DC.md) * [Programs & Tools](Programs/README.md) * [ArangoDB Server](Programs/Arangod/README.md) @@ -62,7 +63,7 @@ * [Examples](Programs/Arangosh/Examples.md) * [Details](Programs/Arangosh/Details.md) * [Options](Programs/Arangosh/Options.md) -# https://@github.com//arangodb-helper/arangodb.git;arangodb;docs/Manual;;/ + * [ArangoDB Starter](Programs/Starter/README.md) * [Options](Programs/Starter/Options.md) * [Security](Programs/Starter/Security.md) @@ -90,7 +91,7 @@ * [Options](Programs/Arangoinspect/Options.md) * [Datafile Debugger](Programs/Arango-dfdb/README.md) * [Examples](Programs/Arango-dfdb/Examples.md) -# https://@github.com/arangodb/foxx-cli.git;foxx-cli;docs/Manual;;/ + * [Foxx CLI](Programs/FoxxCLI/README.md) * [Details](Programs/FoxxCLI/Details.md) @@ -166,7 +167,7 @@ * [Architecture](Architecture/DeploymentModes/Cluster/Architecture.md) * [Data models](Architecture/DeploymentModes/Cluster/DataModels.md) * [Limitations](Architecture/DeploymentModes/Cluster/Limitations.md) -# https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Datacenter to datacenter replication](Architecture/DeploymentModes/DC2DC/README.md) * [Introduction](Architecture/DeploymentModes/DC2DC/Introduction.md) * [Applicability](Architecture/DeploymentModes/DC2DC/Applicability.md) @@ -257,7 +258,7 @@ * [Manual Start](Deployment/Cluster/ManualStart.md) * [Kubernetes](Deployment/Cluster/Kubernetes.md) * [Mesos, DC/OS](Deployment/Cluster/Mesos.md) - # https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Multiple Datacenters](Deployment/DC2DC/README.md) * [Cluster](Deployment/DC2DC/Cluster.md) * [ArangoSync Master](Deployment/DC2DC/ArangoSyncMaster.md) @@ -269,11 +270,13 @@ * [Manually](Deployment/Manually/README.md) * [ArangoDB Starter](Deployment/ArangoDBStarter/README.md) * [Docker](Deployment/Docker/README.md) - # https://@github.com/arangodb/kube-arangodb.git;kube-arangodb;docs/Manual;;/ + * [Kubernetes](Deployment/Kubernetes/README.md) * [Using the Operator](Deployment/Kubernetes/Usage.md) + * [Dashboards](Deployment/Kubernetes/Dashboards.md) * [Deployment Resource Reference](Deployment/Kubernetes/DeploymentResource.md) * [Driver Configuration](Deployment/Kubernetes/DriverConfiguration.md) + * [Helm](Deployment/Kubernetes/Helm.md) * [Authentication](Deployment/Kubernetes/Authentication.md) * [Scaling](Deployment/Kubernetes/Scaling.md) * [Upgrading](Deployment/Kubernetes/Upgrading.md) @@ -328,9 +331,9 @@ * [Syncing Collections](Administration/MasterSlave/SyncingCollections.md) * [Active Failover](Administration/ActiveFailover/README.md) * [Cluster](Administration/Cluster/README.md) -# https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Datacenter to datacenter replication](Administration/DC2DC/README.md) -# https://@github.com/arangodb-helper/arangodb.git;arangodb;docs/Manual;;/ + * [ArangoDB Starter Administration](Administration/Starter/README.md) * [ArangoDB Starter Removal Procedure](Administration/Starter/Removal.md) * [ArangoDB Starter Recovery Procedure](Administration/Starter/Recovery.md) @@ -340,19 +343,19 @@ * [Auditing](Security/Auditing/README.md) * [Configuration](Security/Auditing/AuditConfiguration.md) * [Events](Security/Auditing/AuditEvents.md) -# https://@github.com/arangodb-helper/arangodb.git;arangodb;docs/Manual;;/ + * [Securing Starter Deployments](Security/Starter/README.md) -# https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Datacenter to datacenter replication](Security/DC2DC/README.md) * [Monitoring](Monitoring/README.md) -# https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Datacenter to datacenter replication](Monitoring/DC2DC/README.md) * [Troubleshooting](Troubleshooting/README.md) * [arangod](Troubleshooting/Arangod.md) * [Emergency Console](Troubleshooting/EmergencyConsole.md) * [Cluster](Troubleshooting/Cluster/README.md) * [Agency Dump](Troubleshooting/Cluster/AgencyDump.md) -# https://@github.com/arangodb/arangosync.git;arangosync;docs/Manual;;/ + * [Datacenter to datacenter replication](Troubleshooting/DC2DC/README.md) --- diff --git a/Documentation/Books/Manual/Security/DC2DC/README.md b/Documentation/Books/Manual/Security/DC2DC/README.md index a3a03ee53e..ab12d1f11a 100644 --- a/Documentation/Books/Manual/Security/DC2DC/README.md +++ b/Documentation/Books/Manual/Security/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Datacenter to datacenter Security {% hint 'info' %} diff --git a/Documentation/Books/Manual/Security/Starter/README.md b/Documentation/Books/Manual/Security/Starter/README.md index 0ff0edf6dd..1af555414b 100644 --- a/Documentation/Books/Manual/Security/Starter/README.md +++ b/Documentation/Books/Manual/Security/Starter/README.md @@ -1,4 +1,4 @@ - + Securing Starter Deployments ============================ diff --git a/Documentation/Books/Manual/Troubleshooting/DC2DC/README.md b/Documentation/Books/Manual/Troubleshooting/DC2DC/README.md index f0eb0c65c3..5cb85bebda 100644 --- a/Documentation/Books/Manual/Troubleshooting/DC2DC/README.md +++ b/Documentation/Books/Manual/Troubleshooting/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Troubleshooting datacenter to datacenter replication {% hint 'info' %} diff --git a/Documentation/Books/Manual/Tutorials/DC2DC/README.md b/Documentation/Books/Manual/Tutorials/DC2DC/README.md index cee1cc599b..a8d1875065 100644 --- a/Documentation/Books/Manual/Tutorials/DC2DC/README.md +++ b/Documentation/Books/Manual/Tutorials/DC2DC/README.md @@ -1,4 +1,4 @@ - + # Datacenter to datacenter Replication {% hint 'info' %} @@ -72,7 +72,8 @@ ArangoSync is not a good solution when one of the following applies: To use ArangoSync you need the following: -- Two datacenters, each running an ArangoDB Enterprise Edition cluster, version 3.3 or higher. +- Two datacenters, each running an ArangoDB Enterprise Edition cluster, + version 3.3 or higher, using the RocksDB storage engine. - A network connection between both datacenters with accessible endpoints for several components (see individual components for details). - TLS certificates for ArangoSync master instances (can be self-signed). @@ -103,12 +104,12 @@ consult the [reference manual](../../Deployment/DC2DC/README.md). ### ArangoDB cluster Datacenter to datacenter replication requires an ArangoDB cluster in both data centers, -configured with the RocksDB storage engine. +configured with the `rocksdb` storage engine. Since the cluster agents are so critical to the availability of both the ArangoDB and the ArangoSync cluster, it is recommended to run agents on dedicated machines. Consider these machines "pets". -Coordinators and dbservers can be deployed of other machines that should be considered "cattle". +Coordinators and DBServers can be deployed on other machines that should be considered "cattle". ### Sync Master @@ -135,7 +136,7 @@ Consider these machines "pets". The Sync Worker is responsible for executing synchronization tasks.
For optimal performance at least 1 worker instance must be placed on -every machine that has an ArangoDB `dbserver` running. This ensures that tasks +every machine that has an ArangoDB DBServer running. This ensures that tasks can be executed with minimal network traffic outside of the machine. Since sync workers will automatically stop once their TLS server certificate expires @@ -147,7 +148,7 @@ down for a restart. The sync worker must be reachable on a TCP port 8729 (default). This port must be reachable from inside the datacenter (by sync masters). -The sync workers should be run on all machines that also contain an ArangoDB dbserver. +The sync workers should be run on all machines that also contain an ArangoDB DBServer. The sync worker can be memory intensive when running lots of databases & collections. Consider these machines "cattle". diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/DC2DC.md b/Documentation/Books/Manual/Tutorials/Kubernetes/DC2DC.md index fe7cfd3a2b..77063f90cd 100644 --- a/Documentation/Books/Manual/Tutorials/Kubernetes/DC2DC.md +++ b/Documentation/Books/Manual/Tutorials/Kubernetes/DC2DC.md @@ -1,4 +1,4 @@ - + # Start ArangoDB Cluster to Cluster Synchronization on Kubernetes This tutorial guides you through the steps needed to configure diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/GKE.md b/Documentation/Books/Manual/Tutorials/Kubernetes/GKE.md new file mode 100644 index 0000000000..6ddac82d24 --- /dev/null +++ b/Documentation/Books/Manual/Tutorials/Kubernetes/GKE.md @@ -0,0 +1,120 @@ + +# Start ArangoDB on Google Kubernetes Engine in 5 minutes + +In this guide you'll learn how to run ArangoDB on Google Kubernetes Engine (GKE). + +## Create a Kubernetes cluster + +In order to run ArangoDB on GKE you first need to create a Kubernetes cluster. + +To do so, go to the GKE console. +You'll find a list of existing clusters (initially empty). + +![clusters](./gke-clusters.png) + +Click on `CREATE CLUSTER`. + +In the form that follows, enter information as seen in the screenshot below. + +![create a cluser](./gke-create-cluster.png) + +We've succesfully ran clusters with 4 `1 vCPU` nodes or 3 `2 vCPU` nodes. +Smaller node configurations will likely lead to unschedulable `Pods`. + +Once you click `Create`, you'll return to the list of clusters and your +new cluster will be listed there. + +![with new cluster](./gke-clusters-added.png) + +It will take a few minutes for the cluster to be created. + +Once you're cluster is ready, a `Connect` button will appear in the list. + +![cluster is ready](./gke-clusters-ready.png) + +## Getting access to your Kubernetes cluster + +Once your cluster is ready you must get access to it. +The standard `Connect` button provided by GKE will give you access with only limited +permissions. Since the Kubernetes operator also requires some cluster wide +permissions, you need "administrator" permissions. + +To get these permissions, do the following. + +Prepare your `~/.kube/config` with the following content: + +```yaml +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: + server: https:// + name: my_cluster +contexts: +- context: + cluster: my_cluster + user: my_cluster + name: my_cluster +current-context: my_cluster +kind: Config +preferences: {} +users: +- name: my_cluster + user: + username: admin + password: +``` + +Click on the `Edit` button (pencil image) next to your cluster. +This will lead you to the following page. + +![edit cluster](./gke-edit-cluster.png) + +Copy the `Endpoint` IP address and paste it after `server: https://`. + +The click on `Show credentials`. +The following popup will appear. + +![show credentials](./gke-show-credentials.png) + +Copy the `Password` and paste it after `password:`. + +Close the popup and then return to the cluster list. + +Click on `Connect` next to your cluster. +The following popup will appear. + +![connect to cluster](./gke-connect-to-cluster.png) + +Click on `Run in Cloud Shell`. +It will take some time to launch a shell (in your browser). + +Once ready, run the `gcloud` command that is already prepare in your commandline. + +The run `cat ~/.kube/config` and copy the line that starts with `certificate-authority-data:`. +Override the corresponding line in your local `~/.kube.config` file. + +You should now be able to access your cluster using `kubectl`. + +To verify try a command like: + +```bash +kubectl get pods --all-namespaces +``` + +## Installing `kube-arangodb` + +You can now install the ArangoDB Kubernetes operator in your Kubernetes cluster +on GKE. + +To do so, follow the [Installing kube-arangodb](./README.md#installing-kube-arangodb) instructions. + +## Deploying your first ArangoDB database + +Once the ArangoDB Kubernetes operator has been installed and its `Pods` are in the `Ready` +state, you can launch your first ArangoDB deployment in your Kubernetes cluster +on GKE. + +To do so, follow the [Deploying your first ArangoDB database](./README.md#deploying-your-first-arangodb-database) instructions. + +Note that GKE supports `Services` of type `LoadBalancer`. diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/README.md b/Documentation/Books/Manual/Tutorials/Kubernetes/README.md index 42a75d4be2..e49d2a6200 100644 --- a/Documentation/Books/Manual/Tutorials/Kubernetes/README.md +++ b/Documentation/Books/Manual/Tutorials/Kubernetes/README.md @@ -1,4 +1,4 @@ - + # Start ArangoDB on Kubernetes in 5 minutes Starting an ArangoDB database (either single server or full blown cluster) @@ -38,7 +38,6 @@ For now, any recent Kubernetes cluster will do (e.g. `minikube`). Then run (replace `` with the version of the operator that you want to install): ```bash -kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb//manifests/crd.yaml kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb//manifests/arango-deployment.yaml # Optional kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb//manifests/arango-storage.yaml diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters-added.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters-added.png new file mode 100644 index 0000000000..845a444955 Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters-added.png differ diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters-ready.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters-ready.png new file mode 100644 index 0000000000..7ecf21fd81 Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters-ready.png differ diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters.png new file mode 100644 index 0000000000..dd9a033bf5 Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-clusters.png differ diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-connect-to-cluster.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-connect-to-cluster.png new file mode 100644 index 0000000000..80c824f509 Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-connect-to-cluster.png differ diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-create-cluster.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-create-cluster.png new file mode 100644 index 0000000000..2108d59819 Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-create-cluster.png differ diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-edit-cluster.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-edit-cluster.png new file mode 100644 index 0000000000..cd503e53ca Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-edit-cluster.png differ diff --git a/Documentation/Books/Manual/Tutorials/Kubernetes/gke-show-credentials.png b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-show-credentials.png new file mode 100644 index 0000000000..bf70bbd0f2 Binary files /dev/null and b/Documentation/Books/Manual/Tutorials/Kubernetes/gke-show-credentials.png differ diff --git a/Documentation/Books/Manual/Tutorials/Starter/README.md b/Documentation/Books/Manual/Tutorials/Starter/README.md index d815a71874..8f59437470 100644 --- a/Documentation/Books/Manual/Tutorials/Starter/README.md +++ b/Documentation/Books/Manual/Tutorials/Starter/README.md @@ -1,4 +1,4 @@ - + # Starting an ArangoDB cluster or database the easy way Starting an ArangoDB cluster is complex. It involves starting various servers with diff --git a/Documentation/Scripts/fetchRefs.sh b/Documentation/Scripts/fetchRefs.sh index b4566b2709..13d85f8990 100755 --- a/Documentation/Scripts/fetchRefs.sh +++ b/Documentation/Scripts/fetchRefs.sh @@ -8,19 +8,19 @@ GITAUTH="$1" for book in ${ALLBOOKS}; do - repos=$(grep '^#' ../Books/${book}/SUMMARY.md |grep git |sed 's;# *;;') + repos=$(grep '^ *$;\1;') for oneRepo in ${repos}; do - export REPO=$(echo $oneRepo |cut -d ';' -f 1) - export CLONEDIR=$(echo $oneRepo |cut -d ';' -f 2) - export SUBDIR=$(echo $oneRepo |cut -d ';' -f 3) - export SRC=$(echo $oneRepo |cut -d ';' -f 4) - export DST=$(echo $oneRepo |cut -d ';' -f 5) + REPO=$(echo "$oneRepo" |cut -d ';' -f 1) + CLONEDIR=$(echo "$oneRepo" |cut -d ';' -f 2) + SUBDIR=$(echo "$oneRepo" |cut -d ';' -f 3) + SRC=$(echo "$oneRepo" |cut -d ';' -f 4) + DST=$(echo "$oneRepo" |cut -d ';' -f 5) - export CODIR="../Books/repos/${CLONEDIR}" - export AUTHREPO=$(echo "${REPO}" | sed "s;@;${GITAUTH}@;") + CODIR="../Books/repos/${CLONEDIR}" + AUTHREPO="${REPO/@/${GITAUTH}@}" if test -d "${CODIR}"; then ( cd "${CODIR}" @@ -34,7 +34,7 @@ for book in ${ALLBOOKS}; do fi # extract branch/tag/... for checkout from VERSIONS file - branch=$(cat ../../VERSIONS|grep "EXTERNAL_DOC_${CLONEDIR}=" | sed "s/^EXTERNAL_DOC_${CLONEDIR}=//") + branch=$(grep "EXTERNAL_DOC_${CLONEDIR}=" "../../VERSIONS" | sed "s/^EXTERNAL_DOC_${CLONEDIR}=//") if [ -z "${branch}" ]; then echo "no branch for ${CLONEDIR}, specify in VERSIONS file." @@ -45,19 +45,23 @@ for book in ${ALLBOOKS}; do (cd "${CODIR}" && git checkout "${branch}" && git pull) for oneMD in $(cd "${CODIR}/${SUBDIR}"; find "./${SRC}" -type f |sed "s;\./;;"); do - export oneMD - export NAME=$(basename ${oneMD}) - export MDSUBDIR=$(echo "${oneMD}" | sed "s;${NAME};;") - export DSTDIR="../Books/${book}/${DST}/${MDSUBDIR}" - export TOPREF=$(echo ${MDSUBDIR} | sed 's;\([a-zA-Z]*\)/;../;g') + NAME=$(basename "${oneMD}") + MDSUBDIR="${oneMD/${NAME}/}" + DSTDIR="../Books/${book}/${DST}/${MDSUBDIR}" + TOPREF=$(echo "${MDSUBDIR}" | sed 's;\([a-zA-Z]*\)/;../;g') if test ! -d "${DSTDIR}"; then mkdir -p "${DSTDIR}" fi - ( - echo "" - cat "${CODIR}/${SUBDIR}/${SRC}/${oneMD}" |sed "s;https://docs.arangodb.com/latest;../${TOPREF};g" - ) > "${DSTDIR}/${NAME}" - + sourcefile="${CODIR}/${SUBDIR}/${SRC}/${oneMD}" + targetfile="${DSTDIR}/${NAME}" + if [[ "$sourcefile" == *.md ]]; then + ( + echo "" + sed "s;https://docs.arangodb.com/latest;../${TOPREF};g" "$sourcefile" + ) > "$targetfile" + else + cp "$sourcefile" "$targetfile" + fi done done done
arangodb-java-driverArangoDBnetwork protocolJava version
5.x.x+3.0.0+VelocyStream, HTTP1.6+
4.2.x+3.0.0+VelocyStream, HTTP1.6+
4.1.x3.1.0+VelocyStream1.6+
3.1.x3.1.0+HTTP1.6+