BSON C++ API  2.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BSON C++ API Documentation



This library provides a C++ API for representing BSON data. The code is distributed under the Apache Licence, Version 2. This library has been extracted from a larger cross-platform (mobile and desktop) application library (UMA) developed by Sans Pareil Technologies, Inc..


BSON - short for Binary JSON - is the native document format developed by MongoDB. SPT has standardised on using BSON as the data interchange format, thus avoiding the necessity to transform data from an intermediary format to a native format when processing data.

The C++ API provided by MongoDB is integrated a bit too closely with their own server implementation, and is quite inconvenient to work with in a read-write environment as required by client applications. The BSON API presents a familiar map style interface that represents the schemaless design of BSON documents, while allowing the same easy manipulation of data allowed by map implementations. The map data may at any time to converted to its BSON representation and serialised.


UMA uses a few very popular libraries in its implementation. The major libraries used include:

  • Poco C++ Libraries (Boost Licence).
  • C++ Template Unit Test Framework (TUT - BSD licence). The header files for the unit test framework are included along with the project sources, hence no separate download or install is required to run the Unit Tests.
  • Qt - required for qmake only. The Qt API itself is not used in UMA, although it is an excellent API. We use Poco to provide most of the features that QtCore does, and Marmalade provides the cross-platform UI features.


The current version of the library includes the sources from the Poco::Util namespace that deal with JSON parsing. These sources will be part of Poco version 1.5 (no stable release yet). Once Poco 1.5 is released, these sources will be removed from the project.