diff --git a/.gitignore b/.gitignore index b3007ed5cf..0d5b59e6c1 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,22 @@ core TAGS tags +CMakeCache.txt +CMakeFiles/ +CPackConfig.cmake +CPackSourceConfig.cmake +CTestTestfile.cmake +UnitTests/CMakeFiles/ +UnitTests/CTestTestfile.cmake +UnitTests/cmake_install.cmake +arangod/CMakeFiles/ +arangod/cmake_install.cmake +arangosh/CMakeFiles/ +arangosh/cmake_install.cmake +cmake_install.cmake +lib/CMakeFiles/ +lib/cmake_install.cmake + Documentation/Examples/*.generated Documentation/Books/Users/book.json Documentation/Books/Users/manual.epub diff --git a/Documentation/Books/Users/Edges/README.mdpp b/Documentation/Books/Users/Edges/README.mdpp index 0af6e87174..9321d3ae16 100644 --- a/Documentation/Books/Users/Edges/README.mdpp +++ b/Documentation/Books/Users/Edges/README.mdpp @@ -13,6 +13,9 @@ The values of *_from* and *_to* are immutable once saved. are connection documents that reference other documents. The type of a collection must be specified when a collection is created and cannot be changed afterwards. +To change edge endpoints you would need to remove old document/edge and insert new one. +Other fields can be updated as in default collection. + !SECTION Working with Edges !SUBSECTION Insert diff --git a/Documentation/Examples/012_documentsCollectionUpdateByExample.generated b/Documentation/Examples/012_documentsCollectionUpdateByExample.generated index dcf31f1d79..f3431b6222 100644 --- a/Documentation/Examples/012_documentsCollectionUpdateByExample.generated +++ b/Documentation/Examples/012_documentsCollectionUpdateByExample.generated @@ -1,8 +1,19 @@ -arangosh> db.example.save({ Hello : "world" }); +arangosh> db.example.save({ Hello : "world", foo : "bar" }); { - "_id" : "example/450753419", - "_rev" : "450753419", - "_key" : "450753419" + "_id" : "example/450817260", + "_rev" : "450817260", + "_key" : "450817260" } arangosh> db.example.updateByExample({ Hello: "world" }, { Hello: "foo", World: "bar" }, false); 1 +arangosh> db.example.byExample({ Hello: "foo" }).toArray() +[ + { + "_id" : "example/450817260", + "_key" : "450817260", + "_rev" : "451144940", + "Hello" : "foo", + "foo" : "bar", + "World" : "bar" + } +] diff --git a/arangod/V8Server/v8-collection.cpp b/arangod/V8Server/v8-collection.cpp index 1f9ae04403..c73a982400 100644 --- a/arangod/V8Server/v8-collection.cpp +++ b/arangod/V8Server/v8-collection.cpp @@ -2963,8 +2963,8 @@ static string GetId (const v8::FunctionCallbackInfo& args, int which) /// @EXAMPLES /// /// @EXAMPLE_ARANGOSH_OUTPUT{EDGCOL_01_SaveEdgeCol} -/// ~ db._create("vertex"); -/// ~ db._createEdgeCollection("relation"); +/// db._create("vertex"); +/// db._createEdgeCollection("relation"); /// v1 = db.vertex.insert({ name : "vertex 1" }); /// v2 = db.vertex.insert({ name : "vertex 2" }); /// e1 = db.relation.insert(v1, v2, { label : "knows" }); diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index e29c071f2b..5c3fba2bf3 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -3358,8 +3358,13 @@ static void CreateDatabaseCoordinator (const v8::FunctionCallbackInfo /// require("org/arangodb/users").update(username, password, true); /// require("org/arangodb/users").remove(username); /// ``` +/// Alternatively, you can specify user data directly. For example: /// -/// This method can only be used from within the *_system* database. +/// ```js +/// db._createDatabase("newDB", [], [{ username: "newUser", passwd: "123456", active: true}]) +/// ``` +/// +/// Those methods can only be used from within the *_system* database. /// @endDocuBlock //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/modules/org/arangodb/arango-collection-common.js b/js/common/modules/org/arangodb/arango-collection-common.js index a1c6c38023..3c048c46f3 100644 --- a/js/common/modules/org/arangodb/arango-collection-common.js +++ b/js/common/modules/org/arangodb/arango-collection-common.js @@ -989,6 +989,9 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF /// The document meta-attributes such as *_id*, *_key*, *_from*, /// *_to* cannot be updated. /// +/// Partial update could also be used to append new fields, +/// if there were no old field with same name. +/// /// `collection.updateByExample(document, newValue, keepNull, waitForSync)` /// /// The optional *keepNull* parameter can be used to modify the behavior when @@ -1019,8 +1022,9 @@ ArangoCollection.prototype.replaceByExample = function (example, newValue, waitF /// /// @EXAMPLE_ARANGOSH_OUTPUT{012_documentsCollectionUpdateByExample} /// ~ db._create("example"); -/// db.example.save({ Hello : "world" }); +/// db.example.save({ Hello : "world", foo : "bar" }); /// db.example.updateByExample({ Hello: "world" }, { Hello: "foo", World: "bar" }, false); +/// db.example.byExample({ Hello: "foo" }).toArray() /// ~ db._drop("example"); /// @END_EXAMPLE_ARANGOSH_OUTPUT /// @endDocuBlock