Collects all the documents into a collection of type M[T]
.
Collects all the documents into a collection of type M[T]
.
Given the stopOnError
parameter (which defaults to true), the resulting Future may fail if any
non-fatal exception occurs. If set to false, all the documents that caused exceptions are skipped.
Up to maxDocs
returned by the database may be processed. If stopOnError
is false, then documents that cause error
are dropped, so the result may contain a little less than maxDocs
even if maxDocs
documents were processed.
Collect up to upTo
documents.
States if the Future should fail if any non-fatal exception occurs.
Example:
val cursor = collection.find(query, filter).cursor[BSONDocument] // return the 3 first documents in a Vector[BSONDocument]. val vector = cursor.collect[Vector](3)
Produces an Enumerator of documents.
Produces an Enumerator of documents.
Given the stopOnError
parameter, this Enumerator may stop on any non-fatal exception, or skip and continue.
The returned enumerator may process up to maxDocs
. If stopOnError
is false, then documents that cause error
are dropped, so the enumerator may emit a little less than maxDocs
even if it processes maxDocs
documents.
Enumerate up to maxDocs
documents.
States if the produced Enumerator may stop on non-fatal exception.
an Enumerator of documents.
Produces an Enumerator of Iterator of documents.
Produces an Enumerator of Iterator of documents.
Given the stopOnError
parameter, this Enumerator may stop on any non-fatal exception, or skip and continue.
Enumerate up to maxDocs
documents.
States if the produced Enumerator may stop on non-fatal exception.
an Enumerator of Iterators of documents.
Produces an Enumerator of responses from the database.
Produces an Enumerator of responses from the database.
Given the stopOnError
parameter, this Enumerator may stop on any non-fatal exception, or skip and continue.
Enumerate up to maxDocs
documents.
States if the produced Enumerator may stop on non-fatal exception.
an Enumerator of Responses.
Gets the first document matching the query, if any.
Gets the first document matching the query, if any. The resulting Future may fail if any exception occurs (for example, while deserializing the document).
Example:
val cursor = collection.find(query, filter).cursor[BSONDocument] // return option of the first element. val first: Future[Option[BSONDocument]] = cursor.headOption
Produces an Enumerator of responses from the database.
Produces an Enumerator of responses from the database.
An Enumeratee for error handling should be used to prevent silent failures.
Consider using enumerateResponses
instead.
Enumerate up to maxDocs
documents.
an Enumerator of Responses.
(defaultCursor: StringAdd).self
(defaultCursor: StringFormat).self
Collects all the documents into a List[T]
.
Collects all the documents into a List[T]
.
Given the stopOnError
parameter (which defaults to true), the resulting Future may fail if any
non-fatal exception occurs. If set to false, all the documents that caused exceptions are skipped.
Collect up to maxDocs
documents.
States if the Future should fail if any non-fatal exception occurs.
Example:
val cursor = collection.find(query, filter).cursor[BSONDocument] // return the 3 first documents in a list. val list = cursor.toList(3)
(Since version 0.10.0) consider using collect[List] instead
(defaultCursor: ArrowAssoc[DefaultCursor[T]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(defaultCursor: Ensuring[DefaultCursor[T]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead