couchdb_connector v0.4.3 Couchdb.Connector
Your primary interface for writing to and reading from CouchDB. The exchange format here are Maps. If you want to go more low level and deal with JSON strings instead, please consider using Couchdb.Connector.Reader or Couchdb.Connector.Writer.
Summary
Functions
Create a new document from given map with given id, using no authentication. Clients must make sure that the id has not been used for an existing document in CouchDB. Either provide a UUID or consider using create_generate in case uniqueness cannot be guaranteed
Create a new document from given map with given id, using the provided basic authentication parameters. Clients must make sure that the id has not been used for an existing document in CouchDB. Either provide a UUID or consider using create_generate in case uniqueness cannot be guaranteed
Create a new document from given map with a CouchDB generated id, using no authentication. Fetching the uuid from CouchDB does of course incur a performance penalty as compared to providing one
Create a new document from given map with a CouchDB generated id, using the provided basic authentication parameters. Fetching the uuid from CouchDB does of course incur a performance penalty as compared to providing one
Delete the document with the given id in the given revision, using no authentication. An error will be returned in case the document does not exist or the revision is wrong
Delete the document with the given id in the given revision, using basic authentication. An error will be returned in case the document does not exist or the revision is wrong
Find and return one document with given key in given view. Will return a a Map with an empty list of documents if no document with given key exists. Staleness is set to ‘update_after’
Find and return one document with given key in given view. Will return a Map with an empty list of documents if no document with given key exists. Staleness is set to ‘ok’
Find and return one document with given key in given view, using basic authentication. Will return a Map with an empty list of documents if no document with given key exists. Staleness is set to ‘ok’ which will perform better than ‘update_after’ but potentially deliver stale results
Returns everything found for the given view in the given design document, using no authentication
Returns everything found for the given view in the given design document, using basic authentication
Fetch a single uuid from CouchDB for use in a a subsequent create operation. Clients can retrieve the returned List of UUIDs by getting the value for key “uuids”. The List contains only one element (UUID)
Retrieve the document given by database properties and id, returning it as a Map, using no authentication
Retrieve the document given by database properties and id, returning it as a Map, using the given basic auth credentials for authentication
Update the given document, provided it contains an id field. Raise an error if it does not. Does not use any authentication
Update the given document, provided it contains an id field. Raise an error if it does not. Makes use of the provided basic authentication parameters
Functions
create(Couchdb.Connector.Types.db_properties, map, String.t) :: {:ok, map} | {:error, map}
Create a new document from given map with given id, using no authentication. Clients must make sure that the id has not been used for an existing document in CouchDB. Either provide a UUID or consider using create_generate in case uniqueness cannot be guaranteed.
create(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, map, String.t) :: {:ok, map} | {:error, map}
Create a new document from given map with given id, using the provided basic authentication parameters. Clients must make sure that the id has not been used for an existing document in CouchDB. Either provide a UUID or consider using create_generate in case uniqueness cannot be guaranteed.
create_generate(Couchdb.Connector.Types.db_properties, map) :: {:ok, map} | {:error, map}
Create a new document from given map with a CouchDB generated id, using no authentication. Fetching the uuid from CouchDB does of course incur a performance penalty as compared to providing one.
create_generate(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, map) :: {:ok, map} | {:error, map}
Create a new document from given map with a CouchDB generated id, using the provided basic authentication parameters. Fetching the uuid from CouchDB does of course incur a performance penalty as compared to providing one.
destroy(Couchdb.Connector.Types.db_properties, String.t, String.t) :: {:ok, map} | {:error, map}
Delete the document with the given id in the given revision, using no authentication. An error will be returned in case the document does not exist or the revision is wrong.
destroy(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, String.t, String.t) :: {:ok, map} | {:error, map}
Delete the document with the given id in the given revision, using basic authentication. An error will be returned in case the document does not exist or the revision is wrong.
document_by_key(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.view_key) :: {:ok, map} | {:error, map}
Find and return one document with given key in given view. Will return a a Map with an empty list of documents if no document with given key exists. Staleness is set to ‘update_after’.
document_by_key(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.view_key, :update_after) :: {:ok, map} | {:error, map}
document_by_key(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.view_key, :ok) :: {:ok, map} | {:error, map}
Find and return one document with given key in given view. Will return a Map with an empty list of documents if no document with given key exists. Staleness is set to ‘ok’.
document_by_key(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, Couchdb.Connector.Types.view_key, :update_after) :: {:ok, map} | {:error, map}
document_by_key(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, Couchdb.Connector.Types.view_key, :ok) :: {:ok, map} | {:error, map}
Find and return one document with given key in given view, using basic authentication. Will return a Map with an empty list of documents if no document with given key exists. Staleness is set to ‘ok’ which will perform better than ‘update_after’ but potentially deliver stale results.
fetch_all(Couchdb.Connector.Types.db_properties, String.t, String.t) :: {:ok, map} | {:error, map}
Returns everything found for the given view in the given design document, using no authentication.
fetch_all(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, String.t, String.t) :: {:ok, map} | {:error, map}
Returns everything found for the given view in the given design document, using basic authentication.
fetch_uuid(Couchdb.Connector.Types.db_properties) :: {:ok, map} | {:error, String.t}
Fetch a single uuid from CouchDB for use in a a subsequent create operation. Clients can retrieve the returned List of UUIDs by getting the value for key “uuids”. The List contains only one element (UUID).
get(Couchdb.Connector.Types.db_properties, String.t) :: {:ok, map} | {:error, map}
Retrieve the document given by database properties and id, returning it as a Map, using no authentication.
get(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, String.t) :: {:ok, map} | {:error, map}
Retrieve the document given by database properties and id, returning it as a Map, using the given basic auth credentials for authentication.
update(Couchdb.Connector.Types.db_properties, map) :: {:ok, map} | {:error, map}
Update the given document, provided it contains an id field. Raise an error if it does not. Does not use any authentication.
update(Couchdb.Connector.Types.db_properties, Couchdb.Connector.Types.basic_auth, map) :: {:ok, map} | {:error, map}
Update the given document, provided it contains an id field. Raise an error if it does not. Makes use of the provided basic authentication parameters.