Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section D.3. C++

D.3. C++

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.

D.3.1. Documents

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.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint