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;
}
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.