elixir-cbson

Hex.pm Version

BSON NIF for Elixir language http://bsonspec.org

THANKS

This library has taken many great ideas and codes from Jiffy to make it fasting and flexible.

The API of elixir-cbson is the same as elixir-bson which I always used in my projects.

WARNING

MongoDB Driver

The MongodB driver using this project is here, being changed from elixir-mongo.

Usage

CBson.decode/1,2

The options for decode are:

CBson.encode/1,2

The options for encode are:

Types

BSON TypeElixir TypeNotes
ObjectId%Bson.ObjectId{}
doubledouble
stringstring
docmap or keywords:return_lists
arraylist
binary%Bson.Bin{}
boolatom: true/false
datetime%Bson.UTC{}
Nullnil:use_null/:nil_term
Regex%Bson.Regex{}
JavaScriptnot supported
int32integer
Timestamp%Bson.Timestamp{}
int64integer
Min keyatom: min_key
Max keyatom: max_key

Benchmarking

There're some benchmark cases vs mongodb & elixir-bson

MIX_ENV=bench mix bench