convertible for BsonObject
This commit is contained in:
parent
bff4817970
commit
f173d9d0a7
1 changed files with 15 additions and 0 deletions
|
@ -409,6 +409,21 @@ instance Convertible BsonValue S8.ByteString where
|
|||
safeConvert (BsonString bs) = return $ C8.concat $ L.toChunks bs
|
||||
safeConvert v = unsupportedError v
|
||||
|
||||
instance Convertible BsonDoc BsonValue where
|
||||
safeConvert = return . BsonObject
|
||||
|
||||
instance Convertible [(String, BsonValue)] BsonValue where
|
||||
safeConvert = return . BsonObject . toBsonDoc
|
||||
|
||||
instance Convertible [(L8.ByteString, BsonValue)] BsonValue where
|
||||
safeConvert = return . BsonObject . toBsonDoc
|
||||
|
||||
instance Convertible (Map.Map String BsonValue) BsonValue where
|
||||
safeConvert = return . BsonObject . BsonDoc . Map.mapKeys L8.fromString
|
||||
|
||||
instance Convertible (Map.Map L8.ByteString BsonValue) BsonValue where
|
||||
safeConvert = return . BsonObject . BsonDoc
|
||||
|
||||
instance Convertible BsonValue [Double] where
|
||||
safeConvert (BsonArray a) = mapM safeConvert a
|
||||
safeConvert v = unsupportedError v
|
||||
|
|
Loading…
Reference in a new issue