|
|
|
|
|
| Description |
| Interface to CouchDB.
|
|
| Synopsis |
|
| data CouchMonad a | | | runCouchDB :: String -> Int -> CouchMonad a -> IO a | | | runCouchDB' :: CouchMonad a -> IO a | | | createDB :: String -> CouchMonad () | | | dropDB :: String -> CouchMonad Bool | | | newNamedDoc :: JSON a => String -> String -> a -> CouchMonad (Either String String) | | | newDoc :: JSON a => String -> a -> CouchMonad (JSString, JSString) | | | updateDoc :: JSON a => String -> (JSString, JSString) -> a -> CouchMonad (Maybe (JSString, JSString)) | | | deleteDoc :: String -> (JSString, JSString) -> CouchMonad Bool | | | forceDeleteDoc :: String -> String -> CouchMonad Bool | | | getDocPrim :: String -> String -> CouchMonad (Maybe (JSString, JSString, [(String, JSValue)])) | | | getDoc :: JSON a => String -> String -> CouchMonad (Maybe (JSString, JSString, a)) | | | getAndUpdateDoc :: JSON a => String -> String -> (a -> a) -> CouchMonad (Maybe String) | | | getAllDocIds :: String -> CouchMonad [String] | | | | | newView :: String -> String -> [CouchView] -> CouchMonad () | | | queryView :: JSON a => String -> String -> String -> [(String, JSValue)] -> CouchMonad [(JSString, a)] | | | queryViewKeys :: String -> String -> String -> [(String, JSValue)] -> CouchMonad [String] |
|
|
|
| Initialization
|
|
|
| A computation that interacts with a CouchDB database. This monad
encapsulates the IO monad, a persistent HTTP connnection to a
CouchDB database and enough information to re-open the connection
if it is closed.
| Instances | |
|
|
|
|
|
|
| Connects to the CouchDB server at localhost:5984.
|
|
| Databases
|
|
|
| Creates a new database. Throws an exception if the database already
exists.
|
|
|
|
|
| Documents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| :: String | database
| | -> String | document identifier
| | -> CouchMonad Bool | | | Delete a doc by document identifier (revision number not needed). This
operation first retreives the document to get its revision number. It fails
if the document doesn't exist or there is a conflict.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Views
|
|
| Creating and querying views
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Produced by Haddock version 2.3.0 |