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.

Now let’s do something a little more useful: create databases. For the strict, CouchDB is a database management system (DMS). That means it can hold multiple databases. A database is a bucket that holds "related data".

Function Index

all_docs/1Equivalent to all_docs(Db, #{}).
all_docs/2All Docs.
bulk_docs_save/2save a list of documents.
bulk_docs_save/3
compact/1Compaction compresses the database file by removing unused sections created during updates.
compact/2Like compact/1 but this compacts the view index from the current version of the design document.
create/1Create a database.
create/2Create a database.
delete/1delete database.
delete/2Equivalent to delete(Db).
ensure_full_commit/1Commits any recent changes to the specified database to disk.
ensure_full_commit/2Commits any recent changes to the specified database to disk.
exists/1Returns true if database exists, false if not.
exists/2Returns true if database exists, false if not.
get_missing_revs/2Given a list of document revisions, returns the document revisions that do not exist in the database.
info/1get 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/1

create(Database::db()) -> {ok, db()} | {error, term()}

Equivalent to create(Db, []).

Create a database

create/2

create(Database::db(), Params::list()) -> {ok, db()} | {error, term()}

Create a database

Connections are made to:
          http://Host:PortPrefix/DbName
If 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/1

delete(Database::db()) -> {ok, db()} | {error, term()}

delete database

delete/2

delete(Server::server(), DbName::binary()) -> {ok, db()} | {error, term()}

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 db

exists/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.

info/1

info(Database::db()) -> {ok, binary()} | {error, term()}

get database info


erlang logo

Made with EDoc-S