The underlying cursor
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.
Applies a binary operator to a start value and all bulks of documents retrieved by this cursor, going first to last.
Applies a binary operator to a start value and all bulks of documents retrieved by this cursor, going first to last.
the result type of the binary operator.
the start value.
the maximum number of documents to be read.
the binary operator to be applied when the next response is successfully read.
the binary operator to be applied when failing to get the next response.
Applies a binary operator to a start value and all responses handled by this cursor, going first to last.
Applies a binary operator to a start value and all responses handled by this cursor, going first to last.
the result type of the binary operator.
the start value.
the maximum number of documents to be read.
the binary operator to be applied when the next response is successfully read.
the binary operator to be applied when failing to get the next response.
Applies a binary operator to a start value and all elements retrieved by this cursor, going first to last.
Applies a binary operator to a start value and all elements retrieved by this cursor, going first to last.
the result type of the binary operator.
the start value.
the maximum number of documents to be read.
the binary operator to be applied when the next document is successfully read.
the binary operator to be applied when failing to read the next document.
cursor.foldWhile(Nil: Seq[Person])((s, p) => Cursor.Cont(s :+ p), { (l, e) => println("last valid value: " + l); Cursor.Fail(e) })
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.
(wrappedCursor: StringAdd).self
(wrappedCursor: 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
(wrappedCursor: ArrowAssoc[WrappedCursor[T]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(wrappedCursor: Ensuring[WrappedCursor[T]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
Cursor wrapper, to help to define custom cursor classes.
CursorProducer