NOTE:
Much of this section of documentation has been rewritten and moved: Obtaining the MongoDB C Driver Libraries
NOTE:
Moved: mongo−c−driver Platform Support
NOTE:
Moved: Installing Prebuilt MongoDB C Driver Libraries
NOTE:
Moved: Installing Prebuilt MongoDB C Driver Libraries
You can find a Docker image in Docker Hub along with example usage of using libmongoc to ping a MongoDB database from within a Docker container.
NOTE:
Moved: Building the C Driver Libraries from Source
There are two ways to uninstall the components that have been installed. The first is to invoke the uninstall program directly. On Linux/Unix:
$ sudo /usr/local/share/mongo−c−driver/uninstall.sh
On Windows:
$ C:\mongo−c−driver\share\mongo−c−driver\uninstall.bat
The second way to uninstall is from within the build directory, assuming that it is in the exact same state as when the install command was invoked:
$ sudo cmake −−build . −−target uninstall
The second approach simply invokes the uninstall program referenced in the first approach.
If your attempt to build the C driver fails, please see the README for instructions on requesting assistance.
In the event that you are building the BSON library and/or the C driver to embed with other components and you wish to avoid the potential for collision with components installed from a standard build or from a distribution package manager, you can make use of the BSON_OUTPUT_BASENAME and MONGOC_OUTPUT_BASENAME options to cmake.
$ cmake −DBSON_OUTPUT_BASENAME=custom_bson −DMONGOC_OUTPUT_BASENAME=custom_mongoc ..
The above command would produce libraries named libcustom_bson.so and libcustom_mongoc.so (or with the extension appropriate for the build platform). Those libraries could be placed in a standard system directory or in an alternate location and could be linked to by specifying something like −lcustom_mongoc −lcustom_bson on the linker command line (possibly adjusting the specific flags to those required by your linker).
MongoDB, Inc
2017-present, MongoDB, Inc