Questions tagged [mongo-c-driver]

Officially supported C Driver for MongoDB

MongoDB C Driver is an officially supported driver for MongoDB. It is written in pure C.

More information:

126 questions
2
votes
0 answers

Can't capture collection-insert error after calling mongoc_client_get_server_status()

The MongoDB is down, but I can't capture the error description,the "error" argument in mongoc_collection_insert () is empty. This happened, when I use called mongoc_client_get_server_status() in codes. While, the collectionerror can be shown without…
Z.Chloe
  • 21
  • 2
2
votes
0 answers

g++ options when Use mongodb-c-driver in my c++ project

I added, I$(MONGODBCDRIVER)/inlcude/libmongoc-1.0 -L$(MONGODBCDRIVER)/lib -lmongoc-1.0 to g++ and it works. But I deleted -L$(MONGODBCDRIVER)/lib, it still works. Why? Another question, what does lmongoc-1.0 means? Is it to link the libmongoc-1.0.la…
BAE
  • 8,550
  • 22
  • 88
  • 171
2
votes
2 answers

MongoDB C Driver - Constructing a $lte query BSON?

As follows, the code doesn't work. I'm a newbie about MongoDB C Driver. Could anyone help me to correct my code? Thanks a lot. I want to implement the command "{"_id":{$lt:11832668}}).sort({"_id":-1}". bson laoquery[1]; …
2
votes
1 answer

How to execute a MongoDB query in the native node-mongo-native driver?

is there any way I can pass a MongoDB query like db.things.find() directly to the Mongo C Driver or the Javascript driver node-mongo-native to make a query? I am wondering the native driver is able to evaluate the query and return the result. How…
zs2020
  • 53,766
  • 29
  • 154
  • 219
1
vote
0 answers

Mongo-c-driver Update array

I want to have a set of unique elements in array. If there is no document, matching my query, it should be created. For example: char items_1[][64] = {"cable", "wires", "optic"}; char tags_1[][64] = {"electronics", "supplies", "camera",…
Rodion
  • 27
  • 5
1
vote
1 answer

Is there a findOne operation in the Mongo C driver?

MongoDB implements afindOne() collection operation. However, looking into the collection operations available in the Mongo C driver I haven't found it there. It's a bit surprising, as other drivers implements it (such as the C++…
fgalan
  • 11,732
  • 9
  • 46
  • 89
1
vote
1 answer

Mongocxx library segmentation fault

I'm trying to install the mongo-c-driver and mongo-cxx-driver in a Docker image, but when I run my C++ program it throws a Segmentation fault. Any ideas? Valgrind says it's mongo's fault. I have some IOT devices and in my own computer they run just…
1
vote
1 answer

mongo-cxx driver cannot find polyfill for unique_ptr

I'm trying to build mongo-cxx-driver on Windows; I'm following the instructions, but am getting errors: C1189 #error: "Cannot find a valid polyfill for make_unique" Here's what I did: Building mongo-c-driver I cloned mongo-c-driver using the…
nathan lachenmyer
  • 5,298
  • 8
  • 36
  • 57
1
vote
1 answer

Compiling with Mongo C++ driver returns undefined reference to `u_strFromUTF8_66'

I installed Mongo C++ Driver using following shell script, #!/bin/bash echo "Building MongoDB Core Dependency" cd /home && wget https://github.com/mongodb/mongo-c-driver/releases/download/1.17.0/mongo-c-driver-1.17.0.tar.gz && tar xzf…
user13599244
1
vote
1 answer

mongo c driver ./configure; no such file or directory

I am trying to install mongo-c-driver there follow by http://mongoc.org/libmongoc/1.14.0/installing.html. Snce I don't have the root permission, I ran the following: $ wget…
1
vote
1 answer

bson in mongo-c-driver: update value of already existent field

I'm working with the mongo-c-driver and I have a doubt with the BSON library. As you can see here, there are a lot of functions to append data to already existent bson document (We are talking about bson documents in memory, not stored in the…
Héctor
  • 399
  • 3
  • 16
1
vote
0 answers

MongoDB C++ Driver (mongocxx) single unresolved external symbol (mongocxx::v_noabi::uri::k_default_uri) when running test after installation

For the past two days I have tried to build and test mongocxx on two different Windows 10 machines, one using VS2015 and the other using VS2017. The builds install without errors (though I had initial issues with ENABLE_EXTRA_ALIGNMENT). However,…
M H
  • 41
  • 1
  • 6
1
vote
0 answers

build mongo c driver

I'm trying to build the C driver with Kerberos support, from mongo-c-driver-1.10.3.tar.gz. I'm on Ubuntu 16.04, 64-bit Intel, with gcc 5.4.0. I run CMake like:: $ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. ... -- Build files have…
leao
  • 11
  • 1
1
vote
1 answer

Problem installing Mongo C Driver on ubuntu 16.04

I have installed the Mongo C Driver on ubuntu 16.04 using the command: sudo apt-get install libmongoc-1.0-0 When I try to compile using cmake, I get the following errors: rolf@ubuntu2:~/src/test$ cmake . -- The C compiler identification is GNU…
RR1
  • 333
  • 1
  • 6
  • 13
1
vote
1 answer

find_package with specified version in configuration script name

I need to use mangrove (mongo ODM lib over mongo-c-driver and mongo-cxx-driver) and included this into my project as CMake ExternalProject_Add command, with a dependency on mongo-c-driver/mongo-cxx-driver mongocxx generates CMake configuration…
amigo421
  • 2,429
  • 4
  • 26
  • 55
1 2
3
8 9