| Safe Haskell | None |
|---|
Database.CouchDB.Conduit.Implicit
Description
Implicit methods for CouchDB documents.
All implicit methods needs parser or encoder.
- couchGet :: MonadCouch m => (Value -> Result a) -> Path -> Path -> Query -> m (Revision, a)
- couchPut :: MonadCouch m => (a -> ByteString) -> Path -> Path -> Revision -> Query -> a -> m Revision
- couchPut_ :: MonadCouch m => (a -> ByteString) -> Path -> Path -> Query -> a -> m Revision
- couchPut' :: MonadCouch m => (a -> ByteString) -> Path -> Path -> Query -> a -> m Revision
Accessing documents
Arguments
| :: MonadCouch m | |
| => (Value -> Result a) | Parser |
| -> Path | Document path. |
| -> Path | Document path. |
| -> Query | Query |
| -> m (Revision, a) |
Load CouchDB document and parse it with given parser.
(rev, rawJson) <- couchGet Success "mydb" mydoc []
Manipulating documents
Arguments
| :: MonadCouch m | |
| => (a -> ByteString) | Encoder |
| -> Path | Document path. |
| -> Path | Document path. |
| -> Revision | Document revision. For new docs provide ^ empty string. |
| -> Query | Query arguments. |
| -> a | The object to store. |
| -> m Revision |
Put document, with given encoder
Arguments
| :: MonadCouch m | |
| => (a -> ByteString) | Encoder |
| -> Path | Document path. |
| -> Path | Document path. |
| -> Query | Query arguments. |
| -> a | The object to store. |
| -> m Revision |
"Don't care" version of couchPut. Creates document only in its
absence.
Arguments
| :: MonadCouch m | |
| => (a -> ByteString) | Encoder |
| -> Path | Document path. |
| -> Path | Document path. |
| -> Query | Query arguments. |
| -> a | The object to store. |
| -> m Revision |
Brute force version of couchPut. Creates a document regardless of
presence.