MongoDB C++ Driver
On this page
Welcome to the MongoDB C++ driver. On this site, you'll find documentation to help you get the most from MongoDB and C++. If you're just starting out, take a look at these pages first:
Driver Status by Family and Version
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 | |
Current Driver
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.
Compatibility
MongoDB Compatibility
The following compatibility table specifies the recommended version or versions of the MongoDB C++ driver for use with a specific version of MongoDB.
The first column lists the driver version.
Important
MongoDB ensures compatibility between the MongoDB Server and the drivers for three years after the server version's end of life (EOL) date. To learn more about the MongoDB release and EOL dates, see MongoDB Software Lifecycle Schedules.
Compatibility Table Legend
Icon | Explanation |
---|---|
✓ | All features are supported. |
⊛ | The Driver version will work with the MongoDB version, but not all
new MongoDB features are supported. |
No mark | The Driver version is not tested with the MongoDB version. |
C++ Driver Version | MongoDB 7.0 | MongoDB 6.0 | MongoDB 5.0 | MongoDB 4.4 | MongoDB 4.2 | MongoDB 4.0 | MongoDB 3.6 | MongoDB 3.4 | MongoDB 3.2 | MongoDB 3.0 | MongoDB 2.6 | MongoDB 2.4 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
3.8+ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |||||
3.7 | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ | |||||
3.6 | ⊛ | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
3.5 | ⊛ | ⊛ | ⊛ | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
3.4 | ⊛ | ⊛ | ⊛ | ⊛ | ⊛ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
3.3 | ✓ | ✓ | ✓ | ✓ | ||||||||
3.2 | ✓ | ✓ | ✓ | ✓ | ✓ | |||||||
3.1 | ✓ | ✓ | ✓ | ✓ | ✓ | |||||||
3.0 | ✓ | ✓ | ✓ | ✓ |
The driver does not support older versions of MongoDB.
Language Compatibility
The following compatibility table specifies the recommended version or versions of the MongoDB C++ driver for use with a specific version of C++.
The first column lists the driver version.
C++ Driver Version | C++20 | C++17 | C++14 | C++11 | C++03 |
---|---|---|---|---|---|
3.8+ | ✓ | ✓ | ✓ | ✓ | |
<= 3.7 | ✓ | ✓ | ✓ | ||
1.x | ✓ | ✓ | ✓ |
For more information on how to read the compatibility tables, see our guide on MongoDB Compatibility Tables.
How to get help
Ask questions on our MongoDB Community Forums.
Visit our Support Channels.
See how to report a bug.
License
MongoDB C++ drivers are available under the terms of the Apache License, version 2.0.