mongo-c-driver/1.27.2

A Cross Platform MongoDB Client Library for C
Recipe info
2024-06-05

Available packages
Linux
Windows
macOS
macOS Apple Silicon

Install
Add the following line to your conanfile.txt:
[requires]
mongo-c-driver/1.27.2

Using mongo-c-driver

Note

If you are a new Conan user, we recommend reading the how to consume packages tutorial.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
mongo-c-driver/1.27.2
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("mongo-c-driver/1.27.2")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): mongoc-1.0
  • CMake target name(s): mongo::mongoc_static
  • bson => mongo::bson_static
    mongoc => mongo::mongoc_static
    
  • pkg-config file name(s): mongo-c-driver.pc
  • bson => libbson-static-1.0.pc
    mongoc => libmongoc-static-1.0.pc
    

A simple use case using the CMake file name and the global target:

# ...
find_package(mongoc-1.0 REQUIRED)
# ...
target_link_libraries(YOUR_TARGET mongo::mongoc_static)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the mongo-c-driver homepage listed above:

#include "libbson-1.0/bson.h"
#include "libbson-1.0/bson/bcon.h"
#include "libbson-1.0/bson/bson-atomic.h"
#include "libbson-1.0/bson/bson-clock.h"
#include "libbson-1.0/bson/bson-cmp.h"
#include "libbson-1.0/bson/bson-compat.h"
#include "libbson-1.0/bson/bson-config.h"
#include "libbson-1.0/bson/bson-context.h"
#include "libbson-1.0/bson/bson-decimal128.h"
#include "libbson-1.0/bson/bson-endian.h"
#include "libbson-1.0/bson/bson-error.h"
#include "libbson-1.0/bson/bson-iter.h"
#include "libbson-1.0/bson/bson-json.h"
#include "libbson-1.0/bson/bson-keys.h"
#include "libbson-1.0/bson/bson-macros.h"
#include "libbson-1.0/bson/bson-md5.h"
#include "libbson-1.0/bson/bson-memory.h"
#include "libbson-1.0/bson/bson-oid.h"
#include "libbson-1.0/bson/bson-prelude.h"
#include "libbson-1.0/bson/bson-reader.h"
#include "libbson-1.0/bson/bson-string.h"
#include "libbson-1.0/bson/bson-types.h"
#include "libbson-1.0/bson/bson-utf8.h"
#include "libbson-1.0/bson/bson-value.h"
#include "libbson-1.0/bson/bson-version-functions.h"
#include "libbson-1.0/bson/bson-version.h"
#include "libbson-1.0/bson/bson-writer.h"
#include "libbson-1.0/bson/bson.h"
#include "libmongoc-1.0/mongoc.h"
#include "libmongoc-1.0/mongoc/mongoc-apm.h"
#include "libmongoc-1.0/mongoc/mongoc-bulk-operation.h"
#include "libmongoc-1.0/mongoc/mongoc-change-stream.h"
#include "libmongoc-1.0/mongoc/mongoc-client-pool.h"
#include "libmongoc-1.0/mongoc/mongoc-client-session.h"
#include "libmongoc-1.0/mongoc/mongoc-client-side-encryption.h"
#include "libmongoc-1.0/mongoc/mongoc-client.h"
#include "libmongoc-1.0/mongoc/mongoc-collection.h"
#include "libmongoc-1.0/mongoc/mongoc-config.h"
#include "libmongoc-1.0/mongoc/mongoc-cursor.h"
#include "libmongoc-1.0/mongoc/mongoc-database.h"
#include "libmongoc-1.0/mongoc/mongoc-error.h"
#include "libmongoc-1.0/mongoc/mongoc-find-and-modify.h"
#include "libmongoc-1.0/mongoc/mongoc-flags.h"
#include "libmongoc-1.0/mongoc/mongoc-gridfs-bucket.h"
#include "libmongoc-1.0/mongoc/mongoc-gridfs-file-list.h"
#include "libmongoc-1.0/mongoc/mongoc-gridfs-file-page.h"
#include "libmongoc-1.0/mongoc/mongoc-gridfs-file.h"
#include "libmongoc-1.0/mongoc/mongoc-gridfs.h"
#include "libmongoc-1.0/mongoc/mongoc-handshake.h"
#include "libmongoc-1.0/mongoc/mongoc-host-list.h"
#include "libmongoc-1.0/mongoc/mongoc-index.h"
#include "libmongoc-1.0/mongoc/mongoc-init.h"
#include "libmongoc-1.0/mongoc/mongoc-iovec.h"
#include "libmongoc-1.0/mongoc/mongoc-log.h"
#include "libmongoc-1.0/mongoc/mongoc-macros.h"
#include "libmongoc-1.0/mongoc/mongoc-matcher.h"
#include "libmongoc-1.0/mongoc/mongoc-opcode.h"
#include "libmongoc-1.0/mongoc/mongoc-optional.h"
#include "libmongoc-1.0/mongoc/mongoc-prelude.h"
#include "libmongoc-1.0/mongoc/mongoc-rand.h"
#include "libmongoc-1.0/mongoc/mongoc-read-concern.h"
#include "libmongoc-1.0/mongoc/mongoc-read-prefs.h"
#include "libmongoc-1.0/mongoc/mongoc-server-api.h"
#include "libmongoc-1.0/mongoc/mongoc-server-description.h"
#include "libmongoc-1.0/mongoc/mongoc-sleep.h"
#include "libmongoc-1.0/mongoc/mongoc-socket.h"
#include "libmongoc-1.0/mongoc/mongoc-ssl.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-buffered.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-file.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-gridfs.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-socket.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-tls-libressl.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-tls-openssl.h"
#include "libmongoc-1.0/mongoc/mongoc-stream-tls.h"
#include "libmongoc-1.0/mongoc/mongoc-stream.h"
#include "libmongoc-1.0/mongoc/mongoc-topology-description.h"
#include "libmongoc-1.0/mongoc/mongoc-uri.h"
#include "libmongoc-1.0/mongoc/mongoc-version-functions.h"
#include "libmongoc-1.0/mongoc/mongoc-version.h"
#include "libmongoc-1.0/mongoc/mongoc-write-concern.h"
#include "libmongoc-1.0/mongoc/mongoc.h"