Module couchdb_databases
The
couchdb_mango
module contains functionality listed under CouchDB API
Reference section 1.3.6.
Description
The couchdb_mango
module contains functionality listed under CouchDB API
Reference section 1.3.6.
Function Index
all_docs/1 | Equivalent to all_docs(Db, #{}) .
|
all_docs/2 | All Docs. |
bulk_docs_save/2 | save a list of documents. |
bulk_docs_save/3 | |
compact/1 | Compaction compresses the database file by removing unused sections created during updates. |
compact/2 | Like compact/1 but this compacts the view index from the current version of the design document. |
create/1 | Create a database. |
create/2 | Create a database. |
delete/1 | delete database. |
delete/2 | Equivalent to delete(Db) .
|
ensure_full_commit/1 | Commits any recent changes to the specified database to disk. |
ensure_full_commit/2 | Commits any recent changes to the specified database to disk. |
exists/1 | Returns true if database exists, false if not. |
exists/2 | Returns true if database exists, false if not. |
get_missing_revs/2 | Given a list of document revisions, returns the document revisions that do not exist in the database. |
info/1 | get database info. |
Function Details
all_docs/1
all_docs(Database::db()) -> {ok, binary()} | {error, term()}
Equivalent to all_docs(Db, #{})
.
all_docs/2
all_docs(Database::db(), Options::map()) -> {ok, binary()} | {error, term()}
All Docs
Options: - include_docs (true|false)bulk_docs_save/2
bulk_docs_save(Db, Docs) -> any()
Equivalent to save_docs(Db, Docs, [])
.
save a list of documents
bulk_docs_save/3
bulk_docs_save(Db, Cdr, Options) -> any()
compact/1
compact(Db::db()) -> ok | {error, term()}
Compaction compresses the database file by removing unused sections created during updates. See http://wiki.apache.org/couchdb/Compaction for more informations
compact/2
compact(Db::db(), ViewName::string()) -> ok | {error, term()}
Like compact/1 but this compacts the view index from the current version of the design document. See http://wiki.apache.org/couchdb/Compaction#View_compaction for more informations
create/2
Create a database
Connections are made to:http://Host:PortPrefix/DbNameIf ssl is set https is used. See server_connections for options. Params is a list of optionnal query argument you want to pass to the db. Useful for bigcouch for example. DB names must conform to ^[a-z][a-z0-9_$()+/-]*$
delete/2
Equivalent to delete(Db)
.
ensure_full_commit/1
ensure_full_commit(Db) -> any()
Equivalent to ensure_full_commit(Db, [])
.
Commits any recent changes to the specified database to disk. You should call this if you want to ensure that recent changes have been flushed. This function is likely not required, assuming you have the recommended configuration setting of delayed_commits=false, which requires CouchDB to ensure changes are written to disk before a 200 or similar result is returned.
ensure_full_commit/2
ensure_full_commit(Db::db(), Options::list()) -> {ok, InstancestartTime::binary()} | {error, term()}
Commits any recent changes to the specified database to disk. You should call this if you want to ensure that recent changes have been flushed. This function is likely not required, assuming you have the recommended configuration setting of delayed_commits=false, which requires CouchDB to ensure changes are written to disk before a 200 or similar result is returned.
exists/1
exists(Database::db()) -> boolean()
Equivalent to exists(Server, DatabaseName)
.
Returns true if database exists, false if not
Uses HTTP Headers containing a minimal amount of information about the specified dbexists/2
exists(Server::server(), Name::binary()) -> boolean()
Returns true if database exists, false if not
get_missing_revs/2
get_missing_revs(Db::#db{}, IdRevs::[{binary(), [binary()]}]) -> {ok, [{DocId::binary(), [MissingRev::binary()], [PossibleAncestor::binary()]}]} | {error, term()}
Given a list of document revisions, returns the document revisions that do not exist in the database.
Made with EDoc-S