Explicitly closes that cursor.
Explicitly closes that cursor. It cannot be used again.
Collects all the documents into a collection of type M[T]
.
Collects all the documents into a collection of type M[T]
.
The reuse of this cursor may cause unexpected behavior.
Example:
val cursor2 = collection.find(query, filter).cursor // gather the first 3 documents val futureList = cursor.collect[List](3)
the type of the returned collection.
The maximum size of this collection.
Collects all the documents into a collection of type M[T]
.
Collects all the documents into a collection of type M[T]
.
The reuse of this cursor may cause unexpected behavior.
Example:
val cursor2 = collection.find(query, filter).cursor val futureList = cursor.toList futureList.map { list => list.foreach { doc => println("found document: " + BSONDocument.pretty(doc)) } }
the type of the returned collection.
Enumerates this cursor.
Enumerates this cursor. The reuse of this cursor may cause unexpected behavior.
Example:
// Get a cursor of BSONDocuments val cursor = collection.find(query, filter).cursor // Let's enumerate this cursor and print a readable representation of each document in the response cursor.enumerate.apply(Iteratee.foreach { doc => println("found document: " + BSONDocument.pretty(doc)) })
It is worth diving into the Play! 2.0 Iteratee documentation.
Bulk enumerator.
Bulk enumerator. The reuse of this cursor may cause unexpected behavior.
Much faster when dealing with large collections.
Stop enumerating when at least limit
documents have been received.
Bulk enumerator.
Bulk enumerator. The reuse of this cursor may cause unexpected behavior.
Much faster when dealing with large collections.
Cursor enumerator.
Cursor enumerator. The reuse of this cursor may cause unexpected behavior.
Low-level API, consider enumerate() or enumerateBulks() instead.
Tells if another instance of cursor can be fetched.
Tells if another instance of cursor can be fetched.
Gets the first returned document, if any.
Gets the first returned document, if any.
Example:
val cursor2 = collection.find(query, filter).cursor val maybeOneDoc = cursor2.headOption
An iterator on the last fetched documents.
An iterator on the last fetched documents.
Gets the next instance of that cursor.
Gets the next instance of that cursor.
Collects all the documents into a collection of type M[T]
.
Collects all the documents into a collection of type M[T]
.
The reuse of this cursor may cause unexpected behavior.
Example:
val cursor2 = collection.find(query, filter).cursor // return the 3 first documents in a list. val list = cursor2.toList(3)
Collects all the documents into a collection of type M[T]
.
Collects all the documents into a collection of type M[T]
.
The reuse of this cursor may cause unexpected behavior.
Example:
val cursor2 = collection.find(query, filter).cursor val list = cursor2.toList
(tailableCursor: StringAdd).self
(tailableCursor: StringFormat).self
(tailableCursor: ArrowAssoc[TailableCursor[T]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(tailableCursor: Ensuring[TailableCursor[T]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead