MongoDB

object MongoDB
class Object
trait Matchable
class Any
MongoDB.type

Value members

Concrete methods

def firstBatch(chanId: ChannelId, cursorId: Long, ns: String, firstBatch: Seq[BSONDocument]): Try[Response]

Builds a response for a success batch.

Builds a response for a success batch.

Value parameters:
chanId

Unique ID of channel

def mkCursorResponse(chanId: ChannelId, flags: Int, id: Long, ns: String, firstBatch: Seq[BSONDocument]): Try[Response]
def mkResponse(chanId: ChannelId, flags: Int, docs: Iterable[BSONDocument]): Try[Response]

Builds a Mongo response.

Builds a Mongo response.

Value parameters:
chanId

Unique ID of channel

docs

BSON documents

def queryError(chanId: ChannelId, error: String, code: Option[Int]): Try[Response]

Builds a response with error details for a query.

Builds a response with error details for a query.

Value parameters:
chanId

Unique ID of channel

error

Error message

def querySuccess(chanId: ChannelId, docs: Iterable[BSONDocument]): Try[Response]

Builds a response for a success query.

Builds a response for a success query.

Value parameters:
chanId

Unique ID of channel

docs

BSON documents

def writeError(chanId: ChannelId, error: String, code: Option[Int]): Try[Response]

Builds a response with error details for a write operation.

Builds a response with error details for a write operation.

Value parameters:
chanId

Uniqe ID of channel

code

Error code

error

Error message

Defines instance of WriteOp enum.

Defines instance of WriteOp enum.

def writeSuccess(chanId: ChannelId, count: Int, updatedExisting: Boolean): Try[Response]

Builds a response for a successful write operation.

Builds a response for a successful write operation.

Value parameters:
chanId

Unique ID of channel

count

The number of documents affected by last command, 0 if none

updatedExisting

Some existing document has been updated