Add and expose serverShutdown.
This commit is contained in:
parent
e8be496011
commit
39eec96357
1 changed files with 9 additions and 1 deletions
|
@ -28,7 +28,7 @@ module Database.MongoDB
|
||||||
-- * Connection
|
-- * Connection
|
||||||
Connection,
|
Connection,
|
||||||
connect, connectOnPort, conClose, disconnect, dropDatabase,
|
connect, connectOnPort, conClose, disconnect, dropDatabase,
|
||||||
serverInfo,
|
serverInfo, serverShutdown,
|
||||||
databasesInfo, databaseNames,
|
databasesInfo, databaseNames,
|
||||||
-- * Database
|
-- * Database
|
||||||
Database, MongoDBCollectionInvalid,
|
Database, MongoDBCollectionInvalid,
|
||||||
|
@ -126,6 +126,14 @@ serverInfo :: Connection -> IO BsonDoc
|
||||||
serverInfo c =
|
serverInfo c =
|
||||||
runCommand c (s2L "admin") $ toBsonDoc [("buildinfo", toBson (1::Int))]
|
runCommand c (s2L "admin") $ toBsonDoc [("buildinfo", toBson (1::Int))]
|
||||||
|
|
||||||
|
-- | Shut down the MongoDB server.
|
||||||
|
--
|
||||||
|
-- Force a clean exit, flushing and closing all data files.
|
||||||
|
-- Note that it will wait until all ongoing operations are complete.
|
||||||
|
serverShutdown:: Connection -> IO BsonDoc
|
||||||
|
serverShutdown c =
|
||||||
|
runCommand c (s2L "admin") $ toBsonDoc [("shutdown", toBson (1::Int))]
|
||||||
|
|
||||||
-- | Return a list of collections in /Database/.
|
-- | Return a list of collections in /Database/.
|
||||||
collectionNames :: Connection -> Database -> IO [FullCollection]
|
collectionNames :: Connection -> Database -> IO [FullCollection]
|
||||||
collectionNames c db = do
|
collectionNames c db = do
|
||||||
|
|
Loading…
Reference in a new issue