Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Reasons to recommend the C++ driver include its speed and its closeness to the core server. You’d be hard pressed to find a faster driver, and if you’re interested in MongoDB’s internals, then learning the C++ driver makes for a good entry point into the source code. The C++ driver isn’t so much a standalone driver as an integral internal MongoDB API that’s intermingled with the core code base. That said, facilities exist for using this code as an independent library.
There are two ways to create BSON documents in C++. You can use the somewhat verbose BSONObjBuilder, or you can use the BSON macros that wrap it. I’ll show both methods for each example document.