diff --git a/Documentation/Books/Users/DataModeling/Documents/DocumentMethods.mdpp b/Documentation/Books/Users/DataModeling/Documents/DocumentMethods.mdpp index 1196cac32c..9ec91d84bf 100644 --- a/Documentation/Books/Users/DataModeling/Documents/DocumentMethods.mdpp +++ b/Documentation/Books/Users/DataModeling/Documents/DocumentMethods.mdpp @@ -1129,103 +1129,6 @@ an object with the following sub-attributes: @endDocuBlock 012_documentsCollectionUpdateByExample -!SUBSECTION First - - - -selects the n first documents in the collection -`collection.first(count)` - -The *first* method returns the n first documents from the collection, in -order of document insertion/update time. - -If called with the *count* argument, the result is a list of up to -*count* documents. If *count* is bigger than the number of documents -in the collection, then the result will contain as many documents as there -are in the collection. -The result list is ordered, with the "oldest" documents being positioned at -the beginning of the result list. - -When called without an argument, the result is the first document from the -collection. If the collection does not contain any documents, the result -returned is *null*. - -**Note**: this method is not supported in sharded collections with more than -one shard. - - -**Examples** - - - @startDocuBlockInline documentsCollectionFirstSuccess - @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionFirstSuccess} - ~ 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 documentsCollectionFirstSuccess - - @startDocuBlockInline documentsCollectionFirstNull - @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionFirstNull} - ~ db._create("example"); - ~ db.example.save({ Hello : "world" }); - db.example.first(); - ~ db._drop("example"); - @END_EXAMPLE_ARANGOSH_OUTPUT - @endDocuBlock documentsCollectionFirstNull - - -!SUBSECTION Last - - - -selects the n last documents in the collection -`collection.last(count)` - -The *last* method returns the n last documents from the collection, in -order of document insertion/update time. - -If called with the *count* argument, the result is a list of up to -*count* documents. If *count* is bigger than the number of documents -in the collection, then the result will contain as many documents as there -are in the collection. -The result list is ordered, with the "latest" documents being positioned at -the beginning of the result list. - -When called without an argument, the result is the last document from the -collection. If the collection does not contain any documents, the result -returned is *null*. - -**Note**: this method is not supported in sharded collections with more than -one shard. - - -**Examples** - - - @startDocuBlockInline documentsCollectionLastFound - @EXAMPLE_ARANGOSH_OUTPUT{documentsCollectionLastFound} - ~ 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 documentsCollectionLastFound - - @startDocuBlockInline documentsCollectionLastNull - @EXAMPLE_ARANGOSH_OUTPUT{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