mongoDB-0.4.2: A driver for MongoDB





BsonDoc Operations

empty :: BsonDocSource

An empty BsonDoc

Type Conversion

fromBson :: BsonConv a => BsonValue -> aSource

Convert a BsonValue into a native Haskell type.

toBson :: BsonConv a => a -> BsonValueSource

Convert a native Haskell type into a BsonValue.

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

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.