mirror of https://gitee.com/bigwinds/arangodb
more cleanup on moved docublocks.
This commit is contained in:
parent
a963cfcf8a
commit
87ed6d497a
|
@ -4,7 +4,7 @@
|
|||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief constructs an all query for a collection
|
||||
constructs an all query for a collection
|
||||
`collection.all()`
|
||||
|
||||
Fetches all documents from a collection and returns a cursor. You can use
|
||||
|
@ -49,7 +49,7 @@ Use *limit* to restrict the documents:
|
|||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief constructs a query-by-example for a collection
|
||||
constructs a query-by-example for a collection
|
||||
`collection.byExample(example)`
|
||||
|
||||
Fetches all documents from a collection that match the specified
|
||||
|
@ -112,7 +112,6 @@ Use *toArray* to get all documents at once:
|
|||
|
||||
@startDocuBlockInline 003_collectionByExample
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{003_collectionByExample}
|
||||
@endDocuBlock 003_collectionByExample
|
||||
~ db._create("users");
|
||||
db.users.save({ name: "Gerhard" });
|
||||
db.users.save({ name: "Helmut" });
|
||||
|
@ -123,12 +122,12 @@ Use *toArray* to get all documents at once:
|
|||
db.users.byExample({ "name" : "Helmut", "_id" : "users/15" }).toArray();
|
||||
~ db._drop("users");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock 003_collectionByExample
|
||||
|
||||
Use *next* to loop over all documents:
|
||||
|
||||
@startDocuBlockInline 004_collectionByExampleNext
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{004_collectionByExampleNext}
|
||||
@endDocuBlock 004_collectionByExampleNext
|
||||
~ db._create("users");
|
||||
db.users.save({ name: "Gerhard" });
|
||||
db.users.save({ name: "Helmut" });
|
||||
|
@ -137,6 +136,7 @@ Use *next* to loop over all documents:
|
|||
while (a.hasNext()) print(a.next());
|
||||
~ db._drop("users");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock 004_collectionByExampleNext
|
||||
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ Use *next* to loop over all documents:
|
|||
<!-- js/server/modules/@arangodb/arango-collection.js-->
|
||||
|
||||
|
||||
@brief constructs a query-by-example for a collection
|
||||
constructs a query-by-example for a collection
|
||||
`collection.firstExample(example)`
|
||||
|
||||
Returns the first document of a collection that matches the specified
|
||||
|
@ -160,7 +160,6 @@ As alternative you can supply an array of paths and values.
|
|||
|
||||
@startDocuBlockInline collectionFirstExample
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{collectionFirstExample}
|
||||
@endDocuBlock collectionFirstExample
|
||||
~ db._create("users");
|
||||
~ db.users.save({ name: "Gerhard" });
|
||||
~ db.users.save({ name: "Helmut" });
|
||||
|
@ -168,6 +167,7 @@ As alternative you can supply an array of paths and values.
|
|||
db.users.firstExample("name", "Angela");
|
||||
~ db._drop("users");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock collectionFirstExample
|
||||
|
||||
|
||||
|
||||
|
@ -175,7 +175,7 @@ As alternative you can supply an array of paths and values.
|
|||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief constructs a range query for a collection
|
||||
constructs a range query for a collection
|
||||
`collection.range(attribute, left, right)`
|
||||
|
||||
Returns all documents from a collection such that the *attribute* is
|
||||
|
@ -208,7 +208,6 @@ Use *toArray* to get all documents at once:
|
|||
|
||||
@startDocuBlockInline 005_collectionRange
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{005_collectionRange}
|
||||
@endDocuBlock 005_collectionRange
|
||||
~ db._create("old");
|
||||
db.old.ensureIndex({ type: "skiplist", fields: [ "age" ] });
|
||||
db.old.save({ age: 15 });
|
||||
|
@ -217,6 +216,7 @@ Use *toArray* to get all documents at once:
|
|||
db.old.range("age", 10, 30).toArray();
|
||||
~ db._drop("old")
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock 005_collectionRange
|
||||
|
||||
|
||||
|
||||
|
@ -224,7 +224,7 @@ Use *toArray* to get all documents at once:
|
|||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief constructs a closed range query for a collection
|
||||
constructs a closed range query for a collection
|
||||
`collection.closedRange(attribute, left, right)`
|
||||
|
||||
Returns all documents of a collection such that the *attribute* is
|
||||
|
@ -253,7 +253,6 @@ Use *toArray* to get all documents at once:
|
|||
|
||||
@startDocuBlockInline 006_collectionClosedRange
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{006_collectionClosedRange}
|
||||
@endDocuBlock 006_collectionClosedRange
|
||||
~ db._create("old");
|
||||
db.old.ensureIndex({ type: "skiplist", fields: [ "age" ] });
|
||||
db.old.save({ age: 15 });
|
||||
|
@ -262,13 +261,14 @@ Use *toArray* to get all documents at once:
|
|||
db.old.closedRange("age", 10, 30).toArray();
|
||||
~ db._drop("old")
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock 006_collectionClosedRange
|
||||
|
||||
|
||||
!SUBSECTION Any
|
||||
<!-- js/server/modules/@arangodb/arango-collection.js-->
|
||||
|
||||
|
||||
@brief returns any document from a collection
|
||||
returns any document from a collection
|
||||
`collection.any()`
|
||||
|
||||
Returns a random document from the collection or *null* if none exists.
|
||||
|
@ -278,7 +278,7 @@ Returns a random document from the collection or *null* if none exists.
|
|||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief counts the number of documents in a result set
|
||||
counts the number of documents in a result set
|
||||
`collection.count()`
|
||||
|
||||
Returns the number of living documents in the collection.
|
||||
|
@ -287,11 +287,11 @@ Returns the number of living documents in the collection.
|
|||
|
||||
@startDocuBlockInline collectionCount
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{collectionCount}
|
||||
@endDocuBlock collectionCount
|
||||
~ db._create("users");
|
||||
db.users.count();
|
||||
~ db._drop("users");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock collectionCount
|
||||
|
||||
|
||||
|
||||
|
@ -299,7 +299,7 @@ Returns the number of living documents in the collection.
|
|||
<!-- js/server/modules/@arangodb/arango-collection.js-->
|
||||
|
||||
|
||||
@brief converts collection into an array
|
||||
converts collection into an array
|
||||
`collection.toArray()`
|
||||
|
||||
Converts the collection into an array of documents. Never use this call
|
||||
|
@ -310,7 +310,7 @@ in a production environment.
|
|||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief looks up a document
|
||||
looks up a document
|
||||
`collection.document(document)`
|
||||
|
||||
The *document* method finds a document given its identifier or a document
|
||||
|
@ -340,34 +340,34 @@ Returns the document for a document-handle:
|
|||
|
||||
@startDocuBlockInline documentsCollectionName
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionName}
|
||||
@endDocuBlock documentsCollectionName
|
||||
~ db._create("example");
|
||||
~ var myid = db.example.insert({_key: "2873916"});
|
||||
db.example.document("example/2873916");
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionName
|
||||
|
||||
An error is raised if the document is unknown:
|
||||
|
||||
@startDocuBlockInline documentsCollectionNameUnknown
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionNameUnknown}
|
||||
@endDocuBlock documentsCollectionNameUnknown
|
||||
~ db._create("example");
|
||||
~ var myid = db.example.insert({_key: "2873916"});
|
||||
| db.example.document("example/4472917");
|
||||
~ // xpError(ERROR_ARANGO_DOCUMENT_NOT_FOUND)
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionNameUnknown
|
||||
|
||||
An error is raised if the handle is invalid:
|
||||
|
||||
@startDocuBlockInline documentsCollectionNameHandle
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionNameHandle}
|
||||
@endDocuBlock documentsCollectionNameHandle
|
||||
~ db._create("example");
|
||||
db.example.document(""); // xpError(ERROR_ARANGO_DOCUMENT_HANDLE_BAD)
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionNameHandle
|
||||
|
||||
|
||||
|
||||
|
@ -375,7 +375,7 @@ An error is raised if the handle is invalid:
|
|||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief checks whether a document exists
|
||||
checks whether a document exists
|
||||
`collection.exists(document)`
|
||||
|
||||
The *exists* method determines whether a document exists given its
|
||||
|
@ -405,7 +405,7 @@ first argument.
|
|||
<!-- arangod/V8Server/v8-query.cpp-->
|
||||
|
||||
|
||||
@brief fetches multiple documents by their keys
|
||||
fetches multiple documents by their keys
|
||||
`collection.documents(keys)`
|
||||
|
||||
Looks up the documents in the specified collection using the array of keys
|
||||
|
@ -418,7 +418,6 @@ and no exception will be thrown for them.
|
|||
|
||||
@startDocuBlockInline collectionLookupByKeys
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{collectionLookupByKeys}
|
||||
@endDocuBlock collectionLookupByKeys
|
||||
~ db._drop("example");
|
||||
~ db._create("example");
|
||||
keys = [ ];
|
||||
|
@ -429,13 +428,14 @@ and no exception will be thrown for them.
|
|||
db.example.documents(keys);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock collectionLookupByKeys
|
||||
|
||||
|
||||
!SUBSECTION Insert
|
||||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief insert a new document
|
||||
insert a new document
|
||||
`collection.insert(data)`
|
||||
|
||||
Creates a new document in the *collection* from the given *data*. The
|
||||
|
@ -465,12 +465,12 @@ Note: since ArangoDB 2.2, *insert* is an alias for *save*.
|
|||
|
||||
@startDocuBlockInline documentsCollectionInsert
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionInsert}
|
||||
@endDocuBlock documentsCollectionInsert
|
||||
~ db._create("example");
|
||||
db.example.insert({ Hello : "World" });
|
||||
db.example.insert({ Hello : "World" }, true);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionInsert
|
||||
|
||||
|
||||
|
||||
|
@ -478,7 +478,7 @@ Note: since ArangoDB 2.2, *insert* is an alias for *save*.
|
|||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief replaces a document
|
||||
replaces a document
|
||||
`collection.replace(document, data)`
|
||||
|
||||
Replaces an existing *document*. The *document* must be a document in
|
||||
|
@ -525,25 +525,25 @@ Create and update a document:
|
|||
|
||||
@startDocuBlockInline documentsCollectionReplace
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplace}
|
||||
@endDocuBlock documentsCollectionReplace
|
||||
~ db._create("example");
|
||||
a1 = db.example.insert({ a : 1 });
|
||||
a2 = db.example.replace(a1, { a : 2 });
|
||||
a3 = db.example.replace(a1, { a : 3 }); // xpError(ERROR_ARANGO_CONFLICT);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionReplace
|
||||
|
||||
Use a document handle:
|
||||
|
||||
@startDocuBlockInline documentsCollectionReplaceHandle
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionReplaceHandle}
|
||||
@endDocuBlock documentsCollectionReplaceHandle
|
||||
~ db._create("example");
|
||||
~ var myid = db.example.insert({_key: "3903044"});
|
||||
a1 = db.example.insert({ a : 1 });
|
||||
a2 = db.example.replace("example/3903044", { a : 2 });
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionReplaceHandle
|
||||
|
||||
|
||||
|
||||
|
@ -551,7 +551,7 @@ Use a document handle:
|
|||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief updates a document
|
||||
updates a document
|
||||
`collection.update(document, data, overwrite, keepNull, waitForSync)` or
|
||||
`collection.update(document, data,
|
||||
overwrite: true or false, keepNull: true or false, waitForSync: true or false)`
|
||||
|
@ -602,7 +602,6 @@ Create and update a document:
|
|||
|
||||
@startDocuBlockInline documentsCollectionUpdate
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdate}
|
||||
@endDocuBlock documentsCollectionUpdate
|
||||
~ db._create("example");
|
||||
a1 = db.example.insert({"a" : 1});
|
||||
a2 = db.example.update(a1, {"b" : 2, "c" : 3});
|
||||
|
@ -613,24 +612,24 @@ Create and update a document:
|
|||
db.example.document(a5);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionUpdate
|
||||
|
||||
Use a document handle:
|
||||
|
||||
@startDocuBlockInline documentsCollectionUpdateHandle
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateHandle}
|
||||
@endDocuBlock documentsCollectionUpdateHandle
|
||||
~ db._create("example");
|
||||
~ var myid = db.example.insert({_key: "18612115"});
|
||||
a1 = db.example.insert({"a" : 1});
|
||||
a2 = db.example.update("example/18612115", { "x" : 1, "y" : 2 });
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionUpdateHandle
|
||||
|
||||
Use the keepNull parameter to remove attributes with null values:
|
||||
|
||||
@startDocuBlockInline documentsCollectionUpdateHandleKeepNull
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateHandleKeepNull}
|
||||
@endDocuBlock documentsCollectionUpdateHandleKeepNull
|
||||
~ db._create("example");
|
||||
~ var myid = db.example.insert({_key: "19988371"});
|
||||
db.example.insert({"a" : 1});
|
||||
|
@ -644,12 +643,12 @@ Use the keepNull parameter to remove attributes with null values:
|
|||
db.example.document("example/19988371");
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionUpdateHandleKeepNull
|
||||
|
||||
Patching array values:
|
||||
|
||||
@startDocuBlockInline documentsCollectionUpdateHandleArray
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionUpdateHandleArray}
|
||||
@endDocuBlock documentsCollectionUpdateHandleArray
|
||||
~ db._create("example");
|
||||
~ var myid = db.example.insert({_key: "20774803"});
|
||||
| db.example.insert({"a" : { "one" : 1, "two" : 2, "three" : 3 },
|
||||
|
@ -663,6 +662,7 @@ Patching array values:
|
|||
db.example.document("example/20774803");
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionUpdateHandleArray
|
||||
|
||||
|
||||
|
||||
|
@ -670,7 +670,7 @@ Patching array values:
|
|||
<!-- arangod/V8Server/v8-vocbase.cpp -->
|
||||
|
||||
|
||||
@brief removes a document
|
||||
removes a document
|
||||
`collection.remove(document)`
|
||||
|
||||
Removes a document. If there is revision mismatch, then an error is thrown.
|
||||
|
@ -706,7 +706,6 @@ Remove a document:
|
|||
|
||||
@startDocuBlockInline documentDocumentRemove
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentDocumentRemove}
|
||||
@endDocuBlock documentDocumentRemove
|
||||
~ db._create("example");
|
||||
a1 = db.example.insert({ a : 1 });
|
||||
db.example.document(a1);
|
||||
|
@ -714,12 +713,12 @@ Remove a document:
|
|||
db.example.document(a1); // xpError(ERROR_ARANGO_DOCUMENT_NOT_FOUND);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentDocumentRemove
|
||||
|
||||
Remove a document with a conflict:
|
||||
|
||||
@startDocuBlockInline documentDocumentRemoveConflict
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentDocumentRemoveConflict}
|
||||
@endDocuBlock documentDocumentRemoveConflict
|
||||
~ db._create("example");
|
||||
a1 = db.example.insert({ a : 1 });
|
||||
a2 = db.example.replace(a1, { a : 2 });
|
||||
|
@ -728,6 +727,7 @@ Remove a document with a conflict:
|
|||
db.example.document(a1); // xpError(ERROR_ARANGO_DOCUMENT_NOT_FOUND);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentDocumentRemoveConflict
|
||||
|
||||
|
||||
|
||||
|
@ -735,7 +735,7 @@ Remove a document with a conflict:
|
|||
<!-- arangod/V8Server/v8-query.cpp-->
|
||||
|
||||
|
||||
@brief removes multiple documents by their keys
|
||||
removes multiple documents by their keys
|
||||
`collection.removeByKeys(keys)`
|
||||
|
||||
Looks up the documents in the specified collection using the array of keys
|
||||
|
@ -752,7 +752,6 @@ documents in the *ignored* sub-attribute.
|
|||
|
||||
@startDocuBlockInline collectionRemoveByKeys
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{collectionRemoveByKeys}
|
||||
@endDocuBlock collectionRemoveByKeys
|
||||
~ db._drop("example");
|
||||
~ db._create("example");
|
||||
keys = [ ];
|
||||
|
@ -763,13 +762,14 @@ documents in the *ignored* sub-attribute.
|
|||
db.example.removeByKeys(keys);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock collectionRemoveByKeys
|
||||
|
||||
|
||||
!SUBSECTION Remove By Example
|
||||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief removes documents matching an example
|
||||
removes documents matching an example
|
||||
`collection.removeByExample(example)`
|
||||
|
||||
Removes all documents matching an example.
|
||||
|
@ -798,19 +798,19 @@ removed.
|
|||
|
||||
@startDocuBlockInline 010_documentsCollectionRemoveByExample
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{010_documentsCollectionRemoveByExample}
|
||||
@endDocuBlock 010_documentsCollectionRemoveByExample
|
||||
~ db._create("example");
|
||||
~ db.example.save({ Hello : "world" });
|
||||
db.example.removeByExample( {Hello : "world"} );
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock 010_documentsCollectionRemoveByExample
|
||||
|
||||
|
||||
!SUBSECTION Replace By Example
|
||||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief replaces documents matching an example
|
||||
replaces documents matching an example
|
||||
`collection.replaceByExample(example, newValue)`
|
||||
|
||||
Replaces all documents matching an example with a new document body.
|
||||
|
@ -842,19 +842,19 @@ replaced.
|
|||
|
||||
@startDocuBlockInline 011_documentsCollectionReplaceByExample
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{011_documentsCollectionReplaceByExample}
|
||||
@endDocuBlock 011_documentsCollectionReplaceByExample
|
||||
~ db._create("example");
|
||||
db.example.save({ Hello : "world" });
|
||||
db.example.replaceByExample({ Hello: "world" }, {Hello: "mars"}, false, 5);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock 011_documentsCollectionReplaceByExample
|
||||
|
||||
|
||||
!SUBSECTION Update By Example
|
||||
<!-- js/common/modules/@arangodb/arango-collection-common.js-->
|
||||
|
||||
|
||||
@brief partially updates documents matching an example
|
||||
partially updates documents matching an example
|
||||
`collection.updateByExample(example, newValue)`
|
||||
|
||||
Partially updates all documents matching an example with a new document body.
|
||||
|
@ -905,20 +905,20 @@ an object with the following sub-attributes:
|
|||
|
||||
@startDocuBlockInline 012_documentsCollectionUpdateByExample
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{012_documentsCollectionUpdateByExample}
|
||||
@endDocuBlock 012_documentsCollectionUpdateByExample
|
||||
~ db._create("example");
|
||||
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 012_documentsCollectionUpdateByExample
|
||||
|
||||
|
||||
!SUBSECTION First
|
||||
<!-- js/server/modules/@arangodb/arango-collection.js-->
|
||||
|
||||
|
||||
@brief selects the n first documents in the collection
|
||||
selects the n first documents in the collection
|
||||
`collection.first(count)`
|
||||
|
||||
The *first* method returns the n first documents from the collection, in
|
||||
|
@ -942,29 +942,29 @@ one shard.
|
|||
|
||||
@startDocuBlockInline documentsCollectionFirst
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionFirst}
|
||||
@endDocuBlock documentsCollectionFirst
|
||||
~ db._create("example");
|
||||
~ db.example.save({ Hello : "world" });
|
||||
~ db.example.save({ Foo : "bar" });
|
||||
db.example.first(1);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionFirst
|
||||
|
||||
@startDocuBlockInline documentsCollectionFirstNull
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionFirstNull}
|
||||
@endDocuBlock documentsCollectionFirstNull
|
||||
~ db._create("example");
|
||||
~ db.example.save({ Hello : "world" });
|
||||
db.example.first();
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionFirstNull
|
||||
|
||||
|
||||
!SUBSECTION Last
|
||||
<!-- js/server/modules/@arangodb/arango-collection.js-->
|
||||
|
||||
|
||||
@brief selects the n last documents in the collection
|
||||
selects the n last documents in the collection
|
||||
`collection.last(count)`
|
||||
|
||||
The *last* method returns the n last documents from the collection, in
|
||||
|
@ -988,29 +988,29 @@ one shard.
|
|||
|
||||
@startDocuBlockInline documentsCollectionLast
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionLast}
|
||||
@endDocuBlock documentsCollectionLast
|
||||
~ db._create("example");
|
||||
~ db.example.save({ Hello : "world" });
|
||||
~ db.example.save({ Foo : "bar" });
|
||||
db.example.last(2);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionLast
|
||||
|
||||
@startDocuBlockInline documentsCollectionLastNull
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionLastNull}
|
||||
@endDocuBlock documentsCollectionLastNull
|
||||
~ db._create("example");
|
||||
~ db.example.save({ Hello : "world" });
|
||||
db.example.last(1);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock documentsCollectionLastNull
|
||||
|
||||
|
||||
|
||||
!SUBSECTION Collection type
|
||||
|
||||
|
||||
@brief returns the type of a collection
|
||||
returns the type of a collection
|
||||
`collection.type()`
|
||||
|
||||
Returns the type of a collection. Possible values are:
|
||||
|
@ -1021,7 +1021,7 @@ Returns the type of a collection. Possible values are:
|
|||
!SUBSECTION Get the Version of ArangoDB
|
||||
|
||||
|
||||
@brief return the server version string
|
||||
return the server version string
|
||||
`db._version()`
|
||||
|
||||
Returns the server version string. Note that this is not the version of the
|
||||
|
@ -1031,36 +1031,36 @@ database.
|
|||
|
||||
@startDocuBlockInline dbVersion
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{dbVersion}
|
||||
@endDocuBlock dbVersion
|
||||
require("internal").db._version();
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock dbVersion
|
||||
|
||||
|
||||
!SUBSECTION Misc
|
||||
|
||||
|
||||
@brief returns all edges connected to a vertex
|
||||
returns all edges connected to a vertex
|
||||
`collection.edges(vertex-id)`
|
||||
|
||||
Returns all edges connected to the vertex specified by *vertex-id*.
|
||||
|
||||
|
||||
|
||||
@brief returns inbound edges connected to a vertex
|
||||
returns inbound edges connected to a vertex
|
||||
`collection.inEdges(vertex-id)`
|
||||
|
||||
Returns inbound edges connected to the vertex specified by *vertex-id*.
|
||||
|
||||
|
||||
|
||||
@brief returns outbound edges connected to a vertex
|
||||
returns outbound edges connected to a vertex
|
||||
`collection.outEdges(vertex-id)`
|
||||
|
||||
Returns outbound edges connected to the vertex specified by *vertex-id*.
|
||||
|
||||
|
||||
|
||||
@brief iterates over some elements of a collection
|
||||
iterates over some elements of a collection
|
||||
`collection.iterate(iterator, options)`
|
||||
|
||||
Iterates over some elements of the collection and apply the function
|
||||
|
@ -1079,7 +1079,6 @@ as second argument.
|
|||
|
||||
@startDocuBlockInline accessViaGeoIndex
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{accessViaGeoIndex}
|
||||
@endDocuBlock accessViaGeoIndex
|
||||
~db._create("example")
|
||||
|for (i = -90; i <= 90; i += 10) {
|
||||
| for (j = -180; j <= 180; j += 10) {
|
||||
|
@ -1094,10 +1093,7 @@ as second argument.
|
|||
db.example.index(items[1]);
|
||||
~ db._drop("example");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
|
||||
|
||||
|
||||
|
||||
@endDocuBlock accessViaGeoIndex
|
||||
|
||||
`edge.setProperty(name, value)`
|
||||
|
||||
|
|
|
@ -57,9 +57,10 @@ details, including the index-identifier, is returned.
|
|||
db.ids.save({ "myId": 123 }); // xpError(ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED)
|
||||
~db._drop("ids");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock ensureUniqueSkiplist
|
||||
|
||||
@startDocuBlockInline ensureUniqueSkiplistMultiColmun
|
||||
@EXAMPLE_ARANGOSH_OUTPUT{ensureUniqueSkiplistMultiColmun}
|
||||
@endDocuBlock ensureUniqueSkiplistMultiColmun
|
||||
~db._create("ids");
|
||||
db.ids.ensureIndex({ type: "skiplist", fields: [ "name.first", "name.last" ], unique: true });
|
||||
db.ids.save({ "name" : { "first" : "hans", "last": "hansen" }});
|
||||
|
@ -69,7 +70,7 @@ details, including the index-identifier, is returned.
|
|||
~ // xpError(ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED)
|
||||
~db._drop("ids");
|
||||
@END_EXAMPLE_ARANGOSH_OUTPUT
|
||||
@endDocuBlock ensureUniqueSkiplist
|
||||
@endDocuBlock ensureUniqueSkiplistMultiColmun
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue