MONGOC_INSTALLING(3)

πŸ“¦
version 1.26.0 Β· 3 versions
, in ubuntu noble

πŸ’– MONGOC_INSTALLING(3) πŸ’–

okay bestie, welcome to the libmongoc installing page, aka the manual page formally known as MONGOC_INSTALLING(3). this is where we talk about how you get the C driver onto your machine, how you get it back off again, and how to not let it beef with other stuff you've got installed. let's go πŸ¦‹


✨ NOTE ✨

so here's the tea, and it's a big one: a whole lot of this documentation section has been rewritten and moved. the new home is called Obtaining the MongoDB C Driver Libraries. go there for the fresh version, bestie 🫢


🌸 SUPPORTED PLATFORMS 🌸

NOTE: moved. it now lives at mongo-c-driver Platform Support.

πŸŽ€ INSTALL LIBMONGOC WITH A PACKAGE MANAGER πŸŽ€

NOTE: moved. the new spot is Installing Prebuilt MongoDB C Driver Libraries.

🌈 INSTALL LIBBSON WITH A PACKAGE MANAGER 🌈

NOTE: moved. same destination, bestie: Installing Prebuilt MongoDB C Driver Libraries.

🐳 DOCKER IMAGE 🐳

you can find a Docker image up on Docker Hub, and it even comes with example usage of using libmongoc to ping a MongoDB database from inside a Docker container. containerized and cute, no cap ✨


πŸ”₯ BUILD ENVIRONMENT πŸ”₯

NOTE: moved. it's now at Building the C Driver Libraries from Source.

🧹 Uninstalling the installed components 🧹

there are two ways to uninstall the components you've installed, and honestly? pick your fighter πŸ’…

Way number one: 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

Way number two: do it from inside the build directory β€” but only assuming it's in the exact same state it was in when you ran the install command. important detail, don't skip it πŸ™ˆ

$ sudo cmake --build . --target uninstall

and fun fact: the second approach literally just invokes the uninstall program referenced in the first approach. it's giving "same energy, different door" 😭

😭 Dealing with Build Failures 😭

if your attempt to build the C driver fails, please go check the README for instructions on requesting assistance. you are not alone, bestie 🫢


πŸ‘‘ ADDITIONAL OPTIONS FOR INTEGRATORS πŸ‘‘

so like, hypothetically: you're building the BSON library and/or the C driver to embed with other components, and you wanna avoid any potential for collision with components installed from a standard build or from a distribution package manager. valid concern! in that case you can make use of the BSON_OUTPUT_BASENAME and MONGOC_OUTPUT_BASENAME options to cmake. slay πŸ’…

$ 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. iconic behavior, fr fr ⭐


🌟 AUTHOR 🌟

MongoDB, Inc


2017-present, MongoDB, Inc


okay that's the whole page, you ate that πŸ“ this was version 1.26.0, dated Mar 31, 2024, and it came to you straight from the MONGOC_INSTALLING(3) era of libmongoc. go forth and install responsibly, bestie β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from