Module couchdb_mango


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. The general API exposes a set of actions that are similar to what MongoDB exposes (although not all of MongoDB's API is supported). These are meant to be loosely and obviously inspired by MongoDB but without too much attention to maintaining the exact behavior.

Function Index

find/2Create a new index on a database.
get_indexes/1Get a list of all indexes in the database.
index/2Create a new index on a database.

Function Details

find/2

find(Database::db(), Request::map()) -> {ok, map()} | {error, binary()}

Create a new index on a database

         Request = #{
               <<"selector">> => map(), % required
               <<"limit">> => integer(),
               <<"skip">> => integer(),
               <<"sort">> => map(), % CouchDB Sort Syntax
               <<"fields">> => list(),
               <<"use_index">> => binary() | list(),
               <<"r">> => integer(),
               <<"bookmark">> => binary(),
               <<"update">> => boolean(),
               <<"stable">> => boolean(),
               <<"stale">> => binary(),
               <<"execution_stats">> => boolean(),
         }

get_indexes/1

get_indexes(Database::db()) -> {ok, list()} | {error, binary()}

Get a list of all indexes in the database.

index/2

index(Database::db(), Request::map()) -> {ok, map()} | {error, binary()}

Create a new index on a database

         Request = #{
             <<"index">> => map(), % required
             <<"ddoc">> => binary(),
             <<"name">> => binary(),
             <<"type">> => binary(),
             <<"partial_filter_selector">> => map()
         }


erlang logo

Made with EDoc-S