Registry / database / mongo-c-driver

mongo-c-driver

JSON →
library2.3.0vcpkgunverified

Client library written in C for MongoDB.

vcpkg install mongo-c-driver
INSTALL
IMPORT
SIG · MONGO-C-DRIVER
M
mongo-c-driver
databasecppv2.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.

mongoc/mongoc.h
#include <mongoc/mongoc.h>

Initialize MongoDB client and connect to local instance

#include <mongoc/mongoc.h> int main() { mongoc_init(); mongoc_client_t *client = mongoc_client_new("mongodb://localhost:27017"); mongoc_database_t *db = mongoc_client_get_database(client, "test"); mongoc_database_destroy(db); mongoc_client_destroy(client); mongoc_cleanup(); return 0; }
Debug
Known issues
gotchaThe C driver requires explicit initialization and cleanup with mongoc_init()/mongoc_cleanup()
fix
Always call mongoc_init() before any other driver functions and mongoc_cleanup() at the end
affects: all
Upgrade
Version history
2.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-c-driver — pip install mongo-c-driver · libregistry