diff --git a/Database/MongoDB.hs b/Database/MongoDB.hs index b930cd5..b1caf62 100644 --- a/Database/MongoDB.hs +++ b/Database/MongoDB.hs @@ -27,8 +27,8 @@ module Database.MongoDB ( -- * Connection Connection, - connect, connectOnPort, conClose, disconnect, - dropDatabase, + connect, connectOnPort, conClose, disconnect, dropDatabase, + serverInfo, -- * Database Database, MongoDBCollectionInvalid, ColCreateOpt(..), @@ -106,6 +106,11 @@ dropDatabase c db = do _ <- runCommand c db $ toBsonDoc [("dropDatabase", toBson (1::Int))] 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/. collectionNames :: Connection -> Database -> IO [FullCollection] collectionNames c db = do diff --git a/TODO b/TODO index 9c9996c..11ba236 100644 --- a/TODO +++ b/TODO @@ -20,8 +20,6 @@ MongoDB - hint, explain, $where - database profiling: set/get profiling level, get profiling info - pair mode connection - - connection operations - * server info - operations on database objects * getName * getCollection