AkkaStreamFlattenedCursor

final class AkkaStreamFlattenedCursor[T](cursor: Future[AkkaStreamCursor[T]]) extends FlattenedCursor[T] with AkkaStreamCursor[T]
trait Cursor[T]
class Object
trait Matchable
class Any

Value members

Concrete methods

@silent(".*fromFuture.*")
def bulkSource(maxDocs: Int, err: () => Option[Iterator[T]])(implicit m: Materializer): Source[Iterator[T], Future[State]]
@silent(".*fromFuture.*")
def documentSource(maxDocs: Int, err: () => Option[T])(implicit m: Materializer): Source[T, Future[State]]

Inherited methods

final def bulkPublisher(fanout: Boolean, maxDocs: Int, err: () => Option[Iterator[T]])(implicit m: Materializer): Publisher[Iterator[T]]

Returns a Reactive Streams publisher of bulks from this cursor.

Returns a Reactive Streams publisher of bulks from this cursor.

Value parameters:
err

The binary operator to be applied when failing to get the next response. Exception or Fail raised within the suc function cannot be recovered by this error handler.

fanout

see [[http://doc.akka.io/api/akka/2.4.7/index.html#akka.stream.scaladsl.Sink$@asPublisherT:akka.stream.scaladsl.Sink[T,org.reactivestreams.Publisher[T]] Sink.asPublisher]] (default: false)

m

the stream materializer

maxDocs

the maximum number of documents to be retrieved

Inherited from:
AkkaStreamCursor
def collect[M[_]](maxDocs: Int, err: () => M[T])(implicit cbf: Factory[T, M[T]], ec: ExecutionContext): Future[M[T]]
Inherited from:
FlattenedCursorCompat
final def documentPublisher(fanout: Boolean, maxDocs: Int, err: () => Option[T])(implicit m: Materializer): Publisher[T]

Returns a Reactive Streams publisher of documents from this cursor.

Returns a Reactive Streams publisher of documents from this cursor.

Value parameters:
err

The binary operator to be applied when failing to get the next response. Exception or Fail raised within the suc function cannot be recovered by this error handler.

fanout

see [[http://doc.akka.io/api/akka/2.4.7/index.html#akka.stream.scaladsl.Sink$@asPublisherT:akka.stream.scaladsl.Sink[T,org.reactivestreams.Publisher[T]] Sink.asPublisher]] (default: false)

m

the stream materializer

maxDocs

the maximum number of documents to be retrieved

Inherited from:
AkkaStreamCursor
def fold[A](z: => A, maxDocs: Int)(suc: (A, T) => A)(implicit ec: ExecutionContext): Future[A]

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.

Type parameters:
A

the result type of the binary operator

import scala.concurrent.ExecutionContext
import reactivemongo.api.Cursor
case class Person(name: String, age: Int)
def foo(cursor: Cursor[Person])(implicit ec: ExecutionContext) =
 cursor.foldWhile(Nil: Seq[Person])((s, p) => Cursor.Cont(s :+ p),
   { (l, e) => println("last valid value: " + l); Cursor.Fail(e) })
Value parameters:
err

The binary operator to be applied when failing to get the next response. Exception or Fail raised within the suc function cannot be recovered by this error handler.

maxDocs

the maximum number of documents to be retrieved (-1 for unlimited).

suc

The binary operator to be applied when the next document is successfully read.

z

the initial value

Inherited from:
Cursor
final def foldBulks[A](z: => A, maxDocs: Int)(suc: (A, Iterator[T]) => State[A], err: () => A)(implicit ec: ExecutionContext): Future[A]
Inherited from:
FlattenedCursor
final def foldBulksM[A](z: => A, maxDocs: Int)(suc: (A, Iterator[T]) => Future[State[A]], err: () => A)(implicit ec: ExecutionContext): Future[A]
Inherited from:
FlattenedCursor
final def foldWhile[A](z: => A, maxDocs: Int)(suc: (A, T) => State[A], err: () => A)(implicit ec: ExecutionContext): Future[A]
Inherited from:
FlattenedCursor
final def foldWhileM[A](z: => A, maxDocs: Int)(suc: (A, T) => Future[State[A]], err: () => A)(implicit ec: ExecutionContext): Future[A]
Inherited from:
FlattenedCursor
final def head(implicit ec: ExecutionContext): Future[T]
Inherited from:
FlattenedCursor
final override def headOption(implicit ec: ExecutionContext): Future[Option[T]]
Definition Classes
Inherited from:
FlattenedCursor
def peek[M[_]](maxDocs: Int)(implicit cbf: Factory[T, M[T]], ec: ExecutionContext): Future[Result[M[T]]]
Inherited from:
FlattenedCursorCompat