Docs Menu
Docs Home
/ /

MongoDB C++ Driver

Welcome to the documentation site for the official MongoDB C++ Driver.

Learn how to install the driver, establish a connection to MongoDB, and begin working with data in the Get Started with the C++ Driver tutorial.

Learn how to create and configure a connection to a MongoDB deployment in the Connect to MongoDB section.

Learn how you can retrieve data from MongoDB in the Read Data from MongoDB section.

Learn how you can write data to MongoDB in the Write Data to MongoDB section.

Learn how to work with common types of indexes in the Optimize Queries with Indexes section.

Learn how to use the C++ driver to perform aggregation operations in the Transform Your Data with Aggregation section.

Learn about ways you can authenticate your application and encrypt your data in the Secure Your Data section.

Learn how to work with specialized data formats and custom types in the Specialized Data Formats section.

Learn how to a choose a polyfill library implementation for pre-C++ 17 configurations in the Choose a C++17 Polyfill section.

Learn about advanced configuration and installation options in the Advanced Configuration and Installation Options section.

For a list of new features and changes in each version, see the What's New section.

Learn what changes you might need to make to your application to upgrade driver versions in the Upgrade Driver Versions section.

Learn how to report bugs, contribute to the driver, and find help in the Issues & Help section.

For compatibility tables that show the recommended C++ driver version to use for specific C++ and MongoDB Server versions, see the Compatibility section.

For detailed information about types and methods in the C++ driver, see the C++ driver API documentation.

Stability indicates whether this driver is recommended for production use. Currently, no drivers guarantee API or ABI stability.

For documentation about previous releases, see the legacy documentation.

Family/version
Stability
Development
Purpose
(repo master branch)
Unstable
Active development
New feature development
mongocxx 3.10.x
Stable
Bug fixes only
Current stable C++ driver release
mongocxx 3.9.x
Stable
None
Previous stable C++ driver release
mongocxx 3.8.x
Stable
None
Previous stable C++ driver release
mongocxx 3.7.x
Stable
None
Previous stable C++ driver release
mongocxx 3.6.x
Stable
None
Previous stable C++ driver release
mongocxx 3.5.x
Stable
None
Previous stable C++ driver release
mongocxx 3.4.x
Stable
None
Previous stable C++ driver release
mongocxx 3.3.x
Stable
None
Previous stable C++ driver release
mongocxx 3.2.x
Stable
None
Previous stable C++ driver release
mongocxx 3.1.x
Stable
None
Previous stable C++ driver release
mongocxx 3.0.x
Stable
None
Previous stable C++ driver release |

The mongocxx is a ground-up rewrite of a C++ driver for MongoDB based on libmongoc. It requires a C++11 compiler. It is known to build on x86 and x86-64 architectures for Linux, macOS, Windows, and FreeBSD.

The mongocxx driver library includes a matching bson package, bsoncxx, that implements the BSON specification. This library can be used standalone for object serialization and deserialization even when one is not using MongoDB at all.

Releases of the mongocxx driver have version numbers like v3.x.y.

Note

There were no v2.x.y C++ drivers to avoid confusion with the deprecated legacy-0.0-26compat-2.x.y drivers.

MongoDB C++ drivers are available under the terms of the Apache License, version 2.0.

Next

Get Started