#2273 [ANN] BSON v1.0.0 Released!

SlimerDude Tue 29 Apr 2014

BSON v1.0.0 Released!

Bson is an implementation of the BSON specification complete with serialisation and deserialisation.

Usage

The main BsonReader and BsonWriter classes (de)serialise BSON objects to and from Fantom using the following mapping:

BSON                Fantom
---------------------------------
ARRAY        ->    sys::List
BINARY       -> afBson::Binary
BOOLEAN      ->    sys::Bool
CODE         -> afBson::Code
CODE_W_SCOPE -> afBson::Code
DATE         ->    sys::DateTime
DOCUMENT     ->    sys::Map
DOUBLE       ->    sys::Float
INTEGER_64   ->    sys::Int
MAX_KEY      -> afBson::MaxKey
MIN_KEY      -> afBson::MinKey
NULL         ->         null
OBJECT_ID    -> afBson::ObjectId
REGEX        ->    sys::Regex
STRING       ->    sys::Str
TIMESTAMP    -> afBson::Timestamp

Note that the deprecated BSON constructs UNDEFINED, DB_POINTER and SYMBOL are ignored and have no Fantom representation.

Bson takes care of all the tricky Endianness. All BSON objects (except for Buf and Regex) may also be serialised to and from strings using Fantom's standard serialisation techniques.

Have fun!

: )

brian Thu 1 May 2014

This is very cool, I was actually thinking about a bson implementation just last week!

SlimerDude Thu 1 May 2014

Hmm... and just what would use use BSON for? ;)

Login or Signup to reply.