dropDatabase
This commit is contained in:
parent
9b32259dc8
commit
6569157051
2 changed files with 7 additions and 1 deletions
|
@ -28,6 +28,7 @@ module Database.MongoDB
|
|||
-- * Connection
|
||||
Connection,
|
||||
connect, connectOnPort, conClose, disconnect,
|
||||
dropDatabase,
|
||||
-- * Database
|
||||
Database, MongoDBCollectionInvalid,
|
||||
ColCreateOpt(..),
|
||||
|
@ -93,6 +94,12 @@ conClose = hClose . cHandle
|
|||
disconnect :: Connection -> IO ()
|
||||
disconnect = conClose
|
||||
|
||||
-- | Drop a database.
|
||||
dropDatabase :: Connection -> Database -> IO ()
|
||||
dropDatabase c db = do
|
||||
_ <- dbCmd c db $ toBsonDoc [("dropDatabase", toBson (1::Int))]
|
||||
return ()
|
||||
|
||||
-- | Return a list of collections in /Database/.
|
||||
collectionNames :: Connection -> Database -> IO [Collection]
|
||||
collectionNames c db = do
|
||||
|
|
1
TODO
1
TODO
|
@ -25,7 +25,6 @@ MongoDB
|
|||
* getName
|
||||
* getCollection
|
||||
* executeCommand
|
||||
* dropDatabase (erase)
|
||||
* add_son_manipulators
|
||||
* authenticate
|
||||
* dereference (dbref)
|
||||
|
|
Loading…
Reference in a new issue