diff --git a/Database/MongoDB/Internal/Protocol.hs b/Database/MongoDB/Internal/Protocol.hs index 2bf0916..bf647ed 100644 --- a/Database/MongoDB/Internal/Protocol.hs +++ b/Database/MongoDB/Internal/Protocol.hs @@ -91,9 +91,12 @@ data Pipeline = Pipeline } data ServerData = ServerData - { isMaster :: Bool - , minWireVersion :: Int - , maxWireVersion :: Int + { isMaster :: Bool + , minWireVersion :: Int + , maxWireVersion :: Int + , maxMessageSizeBytes :: Int + , maxBsonObjectSize :: Int + , maxWriteBatchSize :: Int } -- | Create new Pipeline over given handle. You should 'close' pipeline when finished, which will also close handle. If pipeline is not closed but eventually garbage collected, it will be closed along with handle. diff --git a/Database/MongoDB/Query.hs b/Database/MongoDB/Query.hs index 2b00e21..7058c4b 100644 --- a/Database/MongoDB/Query.hs +++ b/Database/MongoDB/Query.hs @@ -304,6 +304,9 @@ retrieveServerData = do { isMaster = (fromMaybe False $ lookup "ismaster" d) , minWireVersion = (fromMaybe 0 $ lookup "minWireVersion" d) , maxWireVersion = (fromMaybe 0 $ lookup "maxWireVersion" d) + , maxMessageSizeBytes = (fromMaybe 48000000 $ lookup "maxMessageSizeBytes" d) + , maxBsonObjectSize = (fromMaybe (16 * 1024 * 1024) $ lookup "maxBsonObjectSize" d) + , maxWriteBatchSize = (fromMaybe 1000 $ lookup "maxWriteBatchSize" d) } return newSd