arg() = {database, database()} | {login, binary()} | {password, binary()} | {w_mode, write_mode()} | {r_mode, read_mode()} | {host, list()} | {port, integer()} | {ssl, boolean()} | {ssl_opts, proplists:proplist()} | {register, atom() | function()}
args() = [arg()]
colldb() = collection() | {database(), collection()}
collection() = binary() | atom()
cursor() = pid()
database() = binary() | atom()
query() = #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()}
read_mode() = master | slave_ok
selector() = map() | bson:document()
write_mode() = unsafe | safe | {safe, bson:document()}
connect/0 | shortcut for connect/1 with default params. |
connect/1 | Make one connection to server, return its pid. |
disconnect/1 | |
database/2 | Switch database. |
get_version/1 | |
insert/3 | Insert a document or multiple documents into a collection. |
insert/4 | |
insert/5 | |
insert/1 | Insert one document or multiple documents into a colleciton. |
update/4 | Replace the document matching criteria entirely with the new Document. |
update/6 | Replace the document matching criteria entirely with the new Document. |
update/7 | Replace the document matching criteria entirely with the new Document. |
update/8 | Replace the document matching criteria entirely with the new Document. |
update/1 | Replace the document matching criteria entirely with the new Document. |
delete/3 | Delete selected documents. |
delete_one/3 | Delete first selected document. |
delete_limit/4 | Delete selected documents. |
delete_limit/5 | Delete selected documents. |
delete_limit/6 | Delete selected documents. |
delete/1 | Delete selected documents params: connection - mc_worker pid collection - collection() selector - selector() database - insert in this database (optional) num - int() number of documents (optional). |
find_one/3 | Return first selected document, if any. |
find_one/4 | Return first selected document, if any. |
find_one/5 | Return first selected document, if any. |
find_one/1 | Return projection of selected documents. |
find_one/2 | |
find/3 | Return selected documents. |
find/4 | |
find/5 | Return projection of selected documents. |
find/1 | Return projection of selected documents. |
find/2 | |
count/3 | Count selected documents. |
count/4 | Count selected documents up to given max number; 0 means no max. |
count/2 | |
count/1 | Return projection of selected documents. |
ensure_index/3 | Create index on collection according to given spec. |
ensure_index/4 | |
command/2 | Execute given MongoDB command and return its result. |
command/3 | Execute given MongoDB command on specific database and return its result. |
command/4 |
connect() -> any()
shortcut for connect/1 with default params.
connect(Args::args()) -> {ok, pid()}
Make one connection to server, return its pid
disconnect(Connection::pid()) -> ok
database(Connection::pid(), Database::database()) -> ok
Switch database
get_version(Connection::pid()) -> float()
insert(Connection::pid(), Coll::collection(), Docs::bson:document()) -> {{boolean(), map()}, bson:document()}
insert(Connection::pid(), Coll::collection(), Docs::map()) -> {{boolean(), map()}, map()}
insert(Connection::pid(), Coll::collection(), Docs::list()) -> {{boolean(), map()}, list()}
Insert a document or multiple documents into a collection. Returns the document or documents with an auto-generated _id if missing.
insert(Connection, Coll, Doc, WC) -> any()
insert(Connection::pid(), Coll::collection(), Doc::bson:document(), WC::bson:document(), DB::database() | undefined) -> {{boolean(), map()}, bson:document()}
insert(Connection::pid(), Coll::collection(), Doc::map(), WC::bson:document(), DB::database() | undefined) -> {{boolean(), map()}, map()}
insert(Connection::pid(), Coll::collection(), Doc::list(), WC::bson:document(), DB::database() | undefined) -> {{boolean(), map()}, list()}
insert(Cmd) -> any()
Insert one document or multiple documents into a colleciton. params: connection - mc_worker pid collection - collection() doc - bson:document() or list database - insert in this database (optional) write_concern - bson:document()
update(Connection::pid(), Coll::collection(), Selector::selector(), Doc::map() | bson:document()) -> {boolean(), map()}
Replace the document matching criteria entirely with the new Document.
update(Connection::pid(), Coll::collection(), Selector::selector(), Doc::map() | bson:document(), Upsert::boolean(), MultiUpdate::boolean()) -> {boolean(), map()}
Replace the document matching criteria entirely with the new Document.
update(Connection::pid(), Coll::collection(), Selector::selector(), Doc::map() | bson:document(), Upsert::boolean(), MultiUpdate::boolean(), WC::bson:document()) -> {boolean(), map()}
Replace the document matching criteria entirely with the new Document.
update(Connection::pid(), Coll::collection(), Selector::selector(), Doc::map() | bson:document(), Upsert::boolean(), MultiUpdate::boolean(), WC::bson:document(), DB::database()) -> {boolean(), map()}
Replace the document matching criteria entirely with the new Document.
update(Cmd) -> any()
Replace the document matching criteria entirely with the new Document. params: connection - mc_worker pid collection - collection() selector - selector() doc - bson:document() or list database - insert in this database (optional) upsert - boolean() do upsert multi - boolean() multiupdate write_concern - bson:document()
delete(Connection::pid(), Coll::collection(), Selector::selector()) -> {boolean(), map()}
Delete selected documents
delete_one(Connection::pid(), Coll::collection(), Selector::selector()) -> {boolean(), map()}
Delete first selected document.
delete_limit(Connection::pid(), Coll::collection(), Selector::selector(), N::integer()) -> {boolean(), map()}
Delete selected documents
delete_limit(Connection::pid(), Coll::collection(), Selector::selector(), N::integer(), WC::bson:document()) -> {boolean(), map()}
Delete selected documents
delete_limit(Connection::pid(), Coll::collection(), Selector::selector(), N::integer(), WC::bson:document(), DB::database()) -> {boolean(), map()}
Delete selected documents
delete(Cmd) -> any()
Delete selected documents params: connection - mc_worker pid collection - collection() selector - selector() database - insert in this database (optional) num - int() number of documents (optional). 0 = all (default) write_concern - bson:document()
find_one(Connection::pid(), Coll::colldb(), Selector::selector()) -> map() | undefined
Return first selected document, if any
find_one(Connection::pid(), Coll::colldb(), Selector::selector(), Args::map()) -> map() | undefined
Return first selected document, if any
find_one(Connection::pid(), Coll::colldb(), Selector::selector(), Args::map(), Db::database()) -> map() | undefined
Return first selected document, if any
find_one(Cmd) -> any()
Return projection of selected documents. params: connection - mc_worker pid collection - collection() selector - selector() database - insert in this database (optional) projector - bson:document() optional skip - int() optional readopts - bson:document() optional
find_one(Connection::pid() | atom(), Query::query()) -> map() | undefined
find(Connection::pid(), Coll::colldb(), Selector::selector()) -> {ok, cursor()} | []
Return selected documents.
find(Connection::pid(), Coll::colldb(), Selector::selector(), Args::map()) -> {ok, cursor()} | []
find(Connection::pid(), Coll::colldb(), Selector::selector(), Args::map(), Db::database()) -> {ok, cursor()} | []
Return projection of selected documents. Empty projection [] means full projection.
find(Cmd) -> any()
Return projection of selected documents. params: connection - mc_worker pid collection - collection() selector - selector() database - insert in this database (optional) projector - bson:document() optional skip - int() optional batchsize - int() optional readopts - bson:document() optional
count(Connection::pid(), Coll::collection(), Selector::selector()) -> integer()
Count selected documents
count(Connection::pid(), Coll::collection(), Selector::selector(), Args::map()) -> integer()
Count selected documents up to given max number; 0 means no max. Ie. stops counting when max is reached to save processing time.
count(Connection::pid() | atom(), Query::bson:document()) -> integer()
count(Cmd) -> any()
Return projection of selected documents. params: connection - mc_worker pid collection - collection() selector - selector() database - insert in this database (optional) limit - int() optional. 0 - no limit readopts - bson:document() optional
ensure_index(Connection::pid(), Coll::colldb(), IndexSpec::bson:document()) -> ok | {error, any()}
Create index on collection according to given spec. The key specification is a bson documents with the following fields: IndexSpec :: bson document, for e.g. {field, 1, other, -1, location, 2d}, required
ensure_index(Connection::pid(), Coll::colldb(), IndexSpec::bson:document(), DB::database()) -> ok | {error, any()}
command(Connection::pid(), Command::selector()) -> {boolean(), map()} | {ok, cursor()}
Execute given MongoDB command and return its result.
command(Db::database(), Connection::pid(), Command::selector()) -> {boolean(), map()} | {ok, cursor()}
Execute given MongoDB command on specific database and return its result.
command(Db, Connection, Command, IsSlaveOk) -> any()
Generated by EDoc