Registry / database / mongo-cxx-driver

mongo-cxx-driver

JSON →
library4.3.0vcpkgunverified

MongoDB C++ Driver.

vcpkg install mongo-cxx-driver
INSTALL
IMPORT
SIG · MONGO-CXX-DRIVER
M
mongo-cxx-driver
databasecppv4.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bsoncxx/json.hpp
#include <bsoncxx/json.hpp>

Connect to MongoDB, insert a document into a collection.

#include <bsoncxx/json.hpp> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> #include <iostream> int main() { mongocxx::instance inst{}; mongocxx::client conn{mongocxx::uri{}}; auto db = conn["test"]; auto collection = db["test"]; auto doc = bsoncxx::builder::basic::make_document( bsoncxx::builder::basic::kvp("hello", "world")); collection.insert_one(doc.view()); std::cout << "Inserted document" << std::endl; return 0; }
Debug
Known issues
gotchaThe MongoDB C++ driver requires a running MongoDB server instance.
fix
Ensure mongod is running and accessible before using the driver.
affects: all
Upgrade
Version history
4.3.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

mongo-cxx-driver — pip install mongo-cxx-driver · libregistry