A high-performance MongoDB driver for C
C M4 C++ Shell CMake Makefile Other
Latest commit 00f5185 Sep 28, 2016 @bjori bjori It was only early betas of 1.0.2 that didn't have this flag
Also, actually include the header file that defines it.
Permalink
Failed to load latest commit information.
.evergreen Have consistent location for the latest snapshot Sep 27, 2016
build CDRIVER-1551 Add collation support for index creation and aggregate Sep 23, 2016
doc seems to be more elements we ignore then I expected Sep 27, 2016
examples CDRIVER-1517 const-correct server description getters Sep 13, 2016
orchestration_configs Workaround BUILD-1998 Aug 26, 2016
src It was only early betas of 1.0.2 that didn't have this flag Sep 28, 2016
tests sync server discovery tests from specs repo Sep 27, 2016
.gitattributes CDRIVER-929 line-endings in test data files Oct 19, 2015
.gitignore CDRIVER-1525 Flexible opts for bulk operations Sep 12, 2016
.gitmodules Ignore stray files/changes in submodules Oct 6, 2015
CMakeLists.txt CDRIVER-1522 add mongoc_collection_find_with_opts Sep 8, 2016
CONTRIBUTING.md CDRIVER-1506 improve mock server logging Sep 2, 2016
COPYING doc: drop appendix from license. Mar 13, 2014
Makefile.am Use tabs in makefiles Sep 3, 2016
NEWS CDRIVER-1517 const-correct server description getters Sep 13, 2016
README.rst updated readme to include build from git instructions for windows and… Jul 7, 2016
VERSION_CURRENT post-release bump Sep 27, 2016
VERSION_RELEASED 1.4.0 Release Aug 10, 2016
autogen.sh CDRIVER-1080: Warn when downloading non-releases from Github Apr 14, 2016
configure.ac CDRIVER-1398 metadata platform field Aug 11, 2016
php.php Rewrite Evergreen config to use shell scripts Aug 26, 2016
valgrind.suppressions CDRIVER-884: Ignore "still reachable" messages from sasl Sep 28, 2015

README.rst

mongo-c-driver

About

mongo-c-driver is a client library written in C for MongoDB.

mongo-c-driver depends on Libbson. Libbson will automatically be built if you do not have it installed on your system.

Documentation / Support / Feedback

The documentation is available at http://api.mongodb.org/c/current/. For issues with, questions about, or feedback for libmongoc, please look into our support channels. Please do not email any of the libmongoc developers directly with issues or questions - you're more likely to get an answer on the mongodb-user list on Google Groups.

Bugs / Feature Requests

Think you’ve found a bug? Want to see a new feature in libmongoc? Please open a case in our issue management tool, JIRA:

Bug reports in JIRA for all driver projects (i.e. CDRIVER, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are public.

How To Ask For Help

If you are having difficulty building the driver after reading the below instructions, please email the mongodb-user list to ask for help. Please include in your email all of the following information:

  • The version of the driver you are trying to build (branch or tag).
    • Examples: master branch, 1.2.1 tag
  • Host OS, version, and architecture.
    • Examples: Windows 8 64-bit x86, Ubuntu 12.04 32-bit x86, OS X Mavericks
  • C Compiler and version.
    • Examples: GCC 4.8.2, MSVC 2013 Express, clang 3.4, XCode 5
  • The output of ./autogen.sh or ./configure (depending on whether you are building from a repository checkout or from a tarball). The output starting from "libbson was configured with the following options" is sufficient.

  • The text of the error you encountered.

Failure to include the relevant information will result in additional round-trip communications to ascertain the necessary details, delaying a useful response. Here is a made-up example of a help request that provides the relevant information:

Hello, I'm trying to build the C driver with SSL, from mongo-c-driver-1.2.1.tar.gz. I'm on Ubuntu 14.04, 64-bit Intel, with gcc 4.8.2. I run configure like:

$ ./configure --enable-sasl=yes
checking for gcc... gcc
checking whether the C compiler works... yes

... SNIPPED OUTPUT, but when you ask for help, include full output without any omissions ...

checking for pkg-config... no
checking for SASL... no
checking for sasl_client_init in -lsasl2... no
checking for sasl_client_init in -lsasl... no
configure: error: You must install the Cyrus SASL libraries and development headers to enable SASL support.

Can you tell me what I need to install? Thanks!

Security Vulnerabilities

If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.

Building the Driver from Source

Detailed installation instructions are in the manual: http://api.mongodb.org/c/current/installing.html

From a tarball

Download the latest release from the release page, then:

$ tar xzf mongo-c-driver-$ver.tar.gz
$ cd mongo-c-driver-$ver
$ ./configure
$ make
$ sudo make install

To see all of the options available to you during configuration, run:

$ ./configure --help

To build on Windows Vista or newer with Visual Studio 2015, do the following:

cd mongo-c-driver-$ver
cd src\libbson
cmake -DCMAKE_INSTALL_PREFIX=C:\usr -G "Visual Studio 14 Win64" .
msbuild.exe ALL_BUILD.vcxproj
msbuild.exe INSTALL.vcxproj
cd ..\..
cmake -DCMAKE_INSTALL_PREFIX=C:\usr -DBSON_ROOT_DIR=C:\usr -G "Visual Studio 14 Win64" .
msbuild.exe ALL_BUILD.vcxproj
msbuild.exe INSTALL.vcxproj

Building From Git

You can use the following to checkout and build mongo-c-driver:

$ git clone https://github.com/mongodb/mongo-c-driver.git
$ cd mongo-c-driver
$ git checkout x.y.z  # To build a particular release
$ ./autogen.sh --with-libbson=bundled
$ make
$ sudo make install

Building from Git on using Visual Studio 2015:

git clone https://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
git checkout x.y.z # for your specific release
git submodule init
git submodule update # libbson is a submodule
cd src\libbson
cmake -DCMAKE_INSTALL_PREFIX=C:\libmongoc -G "Visual Studio 14 Win64" .
msbuild.exe ALL_BUILD.vcxproj
msbuild.exe INSTALL.vcxproj
cd ..\..
cmake -DCMAKE_INSTALL_PREFIX=C:\libmongoc -DENABLE_SSL=WINDOWS -DBSON_ROOT_DIR=C:\libmongoc -G "Visual Studio 14 Win64" .
msbuild.exe ALL_BUILD.vcxproj
msbuild.exe INSTALL.vcxproj