Module mongo_protocol

Data Types

colldb()

colldb() = collection() | {database(), collection()}

collection()

collection() = binary() | atom()

database()

database() = binary() | atom()

message()

message() = notice() | request()

notice()

notice() = #insert{collection = colldb(), documents = [map() | bson:document()]} | #update{collection = colldb(), upsert = boolean(), multiupdate = boolean(), selector = mc_worker_api:selector(), updater = bson:document() | mc_worker_api:modifier()} | #delete{collection = colldb(), singleremove = boolean(), selector = mc_worker_api:selector()} | #killcursor{cursorids = [mc_worker_api:cursorid()]} | #ensure_index{database = database(), collection = colldb(), index_spec = any()}

A request is a syncronous message sent to the server (reply expected)

reply()

reply() = #reply{cursornotfound = boolean(), queryerror = boolean(), awaitcapable = boolean(), cursorid = mc_worker_api:cursorid(), startingfrom = integer(), documents = [map()]}

message id

request()

request() = #query{database = database(), collection = colldb(), tailablecursor = boolean(), slaveok = boolean(), sok_overriden = boolean(), nocursortimeout = boolean(), awaitdata = boolean(), skip = mc_worker_api:skip(), batchsize = mc_worker_api:batchsize(), selector = mc_worker_api:selector(), projector = mc_worker_api:projector()} | #getmore{collection = colldb(), batchsize = mc_worker_api:batchsize(), cursorid = mc_worker_api:cursorid()}

A reply to a request

requestid()

requestid() = integer()

Function Index

dbcoll/2Concat db and collection name with period (.) in between.
put_message/3
get_reply/1

Function Details

dbcoll/2

dbcoll(Db::database(), Coll::colldb()) -> bson:utf8()

Concat db and collection name with period (.) in between

put_message/3

put_message(Db::mc_worker_api:database(), Insert::message(), RequestId::requestid()) -> binary()

get_reply/1

get_reply(Message::binary()) -> {requestid(), reply(), binary()}


Generated by EDoc