AesonBson-0.2.0: Mapping between Aeson's JSON and Bson objects.

Safe HaskellNone

Data.AesonBson

Description

Convert JSON to BSON and the other way around.

Note that BSON has more data types than JSON, so some BSON to JSON conversions are not bijective and somewhat arbitrary.

This means that for some BSON objects:

bsonify . aesonify /= id
bsonifyValue . aesonifyValue /= id

We tried to choose sensible translations on those cases.

Synopsis

Documentation

aesonify :: Document -> ObjectSource

Converts a BSON document to an AESON object.

aesonifyValue :: Value -> ValueSource

Converts a BSON value to JSON.

bsonify :: Object -> DocumentSource

Converts an AESON object to a BSON document.

bsonifyValue :: Value -> ValueSource

Converts a JSON value to BSON.