Questions tagged [mongodb-c]

The MongoDB C Driver is the officially supported driver for MongoDB. It is written in C89 compatible C.

MongoDB C Driver is a client library written in C for MongoDB.

For the official MongoDB C documentation, go to http://mongoc.org/libmongoc/current/index.html

47 questions
5
votes
4 answers

Using the mongodb cxx driver in a cmake c++ project

I am new to cmake and I want to connect to a mongodb using c++ and the latest mongodb cxx driver. I managed to compile and install the driver but now I stuck with using it in my cmake project. I installed the mongodb driver with the default…
paddy_89
  • 298
  • 2
  • 5
3
votes
0 answers

error handling in new mongodb C driver

In the old legacy C driver, I had all of my transactions wrapped in a loop to reconnect and try a second time on dropped connection (MONGO_IO_ERROR) or other unidentified errors. Is this still necessary with the new driver, or does it handle…
user1055568
  • 1,349
  • 13
  • 21
3
votes
1 answer

Libbson and MongoDB-C driver compilation

I would like to install the new update of the MongoDB-C driver but it seems that the compilation logically blocks while including the libbson library (#include ) previously installed in the directory "/usr/local/". How to "link" my libraries…
John S
  • 231
  • 3
  • 11
3
votes
1 answer

How to use MongoDB C driver for Qt Creator?

I want to develop a Qt GUI application with MongoDB serving as the back-end database. So I need to use MongoDB C driver or C++ driver. Truth be told, it's kind of difficult to build a C++ driver under Windows. When I do "scons", it can't find boost…
Ivan Jobs
  • 71
  • 1
  • 4
3
votes
2 answers

Query on large collections using the MongoDb C++ driver differs from shell

Windows 7 64 SP1 -- MongoDB 2.2.0-rc2 -- Boost 1.42 -- MS VS 2010 Ultimate -- C++ driver Following "Mongo in Action", in the shell: for(i=0; i<200000; i++){ db.numbers.save({num: i}); } db.numbers.find() displays: { "_id":…
Therefore
  • 367
  • 2
  • 13
3
votes
1 answer

mongodb c-driver $orderby in queries

I'm trying to make a query to mongo collection using sort ($orderby) keyword. Here is bson-query object without $orderby: bson cmd; bson_init( &cmd ); bson_append_string( &cmd, "ip", ip.c_str() ); bson_append_start_object( &cmd, "timestamp"…
eugenemail
  • 123
  • 1
  • 5
2
votes
1 answer

How to use $Orderby in news MongoDB-C

I can get my query results but I can not manage to retrieve them in ascending (or descending) order according to the value of my field "X" (int32). Could you help me? Note that I use the latest version of MongoDB-C and in the old version I could…
John S
  • 231
  • 3
  • 11
2
votes
3 answers

MongoDB, ZeroMQ and C

i'm with a great problem, i have some code using ZeroMQ and C, and another code that uses MongoDB and C, now i have to merge this codes, but when i try to compile using this command: gcc -static -lzmq -o logg logger.c…
guisantogui
  • 4,017
  • 9
  • 49
  • 93
1
vote
1 answer

Mongo dB c++ driver installation issues in Windows

I was installing mongo DB C++ driver on windows using this http://mongocxx.org/ . My aim is to write mongo dB code on Qt Creator using C++. so I am a beginner so the steps given in above link not in details . if anybody did this before please…
VIVEK A
  • 27
  • 6
1
vote
1 answer

MongoDB c Driver extracting arrays from bson

I am attempting to extract an array from a MongoDB document using the c driver. The document is structured like this: name: "TestName" data:["testData1","testData2"]; I have retrieved the document like this: cursor =…
Shawn
  • 45
  • 1
  • 11
1
vote
2 answers

LibBSON export to buffer

I'm searching for a way to copy a BSON document to a buffer or into a file using the C-library libbson. I think I'm missing something - any help is appreciated.
zille
  • 95
  • 10
1
vote
1 answer

connect.c:1:18: fatal error: bson.h: No such file or directory

I installed the MongoDB C driver using the instructions here (under the 'Building from a release tarball' section: http://api.mongodb.com/c/current/installing.html#installing-unix, and have been getting the following errors when trying to compile…
1
vote
0 answers

C Driver ,how to get Document Fileds Data objects without converting to json string

Im using the C driver to make operations on mongoDB , when i do simple "find" operation shown here : while (mongoc_cursor_next (cursor, &doc)) { str = bson_as_json (doc, NULL); printf ("%s\n", str); bson_free (str); } i want to…
user63898
  • 29,839
  • 85
  • 272
  • 514
1
vote
1 answer

Mongodb C++11 API errno interference

It seems that a lot of mongodb c++11 functions change the system errno code to 11 (EWOULDBLOCK / EAGAIN). This is currently interfering with the rest of my program. I have a couple of questions: What is the reason mongodb changes the errno to…
dontarius
  • 99
  • 1
  • 8
1
vote
2 answers

Updating Array in MongoDB New C Driver

Until Last month, I was using Legacy C Driver but from last week i shifted to the new C Driver, which looks quite good and easy to use. I saved a document in the DB like which have 3 strings, 2 integers and 2 arrays. Now i want to update this array.…
Hamid
  • 137
  • 1
  • 11
1
2 3 4