- data BsonValue
- = BsonDouble Double
- | BsonString ByteString
- | BsonDoc BsonDoc
- | BsonArray [BsonValue]
- | BsonUndefined
- | BsonBinary BinarySubType ByteString
- | BsonObjectId Integer
- | BsonBool !Bool
- | BsonDate POSIXTime
- | BsonNull
- | BsonRegex ByteString String
- | BsonJSCode ByteString
- | BsonSymbol ByteString
- | BsonJSCodeWScope ByteString BsonDoc
- | BsonInt32 Int32
- | BsonInt64 Int64
- | BsonMinKey
- | BsonMaxKey
- type BsonDoc = [(ByteString, BsonValue)]
- data BinarySubType
- = BSTUNDEFINED1
- | BSTFunction
- | BSTByteArray
- | BSTUUID
- | BSTUNDEFINED2
- | BSTMD5
- | BSTUserDefined
- empty :: BsonDoc
- fromBson :: BsonConv a => BsonValue -> a
- toBson :: BsonConv a => a -> BsonValue
- fromBsonDoc :: BsonDocConv a => BsonDoc -> a
- toBsonDoc :: BsonDocConv a => a -> BsonDoc
- getBsonDoc :: Get BsonDoc
- putBsonDoc :: BsonDoc -> Put
- data ObjectIdGen
- mkObjectIdGen :: IO ObjectIdGen
- genObjectId :: ObjectIdGen -> IO BsonValue
Types
BsonValue is the type that can be used as a value in a BsonDoc
.
type BsonDoc = [(ByteString, BsonValue)]Source
data BinarySubType Source
BsonDoc Operations
Type Conversion
fromBsonDoc :: BsonDocConv a => BsonDoc -> aSource
Convert a BsonDoc into another form such as a Map or a tuple list with String keys.
toBsonDoc :: BsonDocConv a => a -> BsonDocSource
Convert a Map or a tuple list with String keys into a BsonDoc.
Binary encoding/decoding
getBsonDoc :: Get BsonDocSource
Decode binary bytes into BsonDoc
.
putBsonDoc :: BsonDoc -> PutSource
Encode BsonDoc
into binary bytes.
ObjectId creation
data ObjectIdGen Source
mkObjectIdGen :: IO ObjectIdGenSource
Create a new ObjectIdGen
, the structure that must be passed to
genObjectId to create a ObjectId
.
genObjectId :: ObjectIdGen -> IO BsonValueSource
Create a new ObjectId
.