dropDatabase

This commit is contained in:
Scott R. Parish 2010-01-18 21:31:21 -06:00
parent 9b32259dc8
commit 6569157051
2 changed files with 7 additions and 1 deletions

View file

@ -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
View file

@ -25,7 +25,6 @@ MongoDB
* getName
* getCollection
* executeCommand
* dropDatabase (erase)
* add_son_manipulators
* authenticate
* dereference (dbref)