mongoDB-0.1: A driver for MongoDB

Database.MongoDB.BSON

Contents

Synopsis

Types

data BsonValue Source

BsonValue is the type that can be used as a key in a BsonDoc.

Instances

newtype BsonDoc Source

BSON Document: this is the top-level (but recursive) type that all MongoDB collections work in terms of. It is a mapping between strings (Data.ByteString.Lazu.UTF8.ByteString) and BsonValues. It can be constructed either from a Map (eg BsonDoc myMap) or from a associative list (eg toBsonDoc myAL).

Constructors

BsonDoc 

toBsonDoc :: BsonDocOps a => [(a, BsonValue)] -> BsonDocSource

Construct a BsonDoc from an associative list

BsonDoc Operations

empty :: BsonDocSource

An empty BsonDoc

lookup :: BsonDocOps a => a -> BsonDoc -> Maybe BsonValueSource

Return the BsonValue for given key, if any.

Conversion

fromBson :: (BsonConv a b, Convertible a b) => a -> bSource

Convert a BsonValue into a native Haskell type.

toBson :: (BsonConv a b, Convertible b a) => b -> aSource

Convert a native Haskell type into a BsonValue.