serverInfo

This commit is contained in:
Scott R. Parish 2010-01-21 21:09:20 -06:00
parent e8f6141529
commit 6bf32ab9eb
2 changed files with 7 additions and 4 deletions

View file

@ -27,8 +27,8 @@ module Database.MongoDB
( (
-- * Connection -- * Connection
Connection, Connection,
connect, connectOnPort, conClose, disconnect, connect, connectOnPort, conClose, disconnect, dropDatabase,
dropDatabase, serverInfo,
-- * Database -- * Database
Database, MongoDBCollectionInvalid, Database, MongoDBCollectionInvalid,
ColCreateOpt(..), ColCreateOpt(..),
@ -106,6 +106,11 @@ dropDatabase c db = do
_ <- runCommand c db $ toBsonDoc [("dropDatabase", toBson (1::Int))] _ <- runCommand c db $ toBsonDoc [("dropDatabase", toBson (1::Int))]
return () return ()
-- | Get information about the MongoDB server we're connected to.
serverInfo :: Connection -> IO BsonDoc
serverInfo c = do
runCommand c (s2L "admin") $ toBsonDoc [("buildinfo", 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

2
TODO
View file

@ -20,8 +20,6 @@ MongoDB
- hint, explain, $where - hint, explain, $where
- database profiling: set/get profiling level, get profiling info - database profiling: set/get profiling level, get profiling info
- pair mode connection - pair mode connection
- connection operations
* server info
- operations on database objects - operations on database objects
* getName * getName
* getCollection * getCollection