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
3
votes
1 answer

MongoDB Create dynamic Query

Below is working code for 'And' Operation of Multiple Queries, I can able to do 'And' operation for list of Queries, 'Or' operation for list of Queries. But is there a way in MongoDB that i can do 'And' or 'Or' operation Dynamically for list of…
Dheeraj Palagiri
  • 1,829
  • 3
  • 23
  • 46
3
votes
2 answers

BCON for mongo-c-driver: Find by _id

I have managed to do better things with C Driver, but stuck on this simple point: How do I search by a known Id? Among many things, this is what I have tried that seemed most logical: query = BCON_NEW ( "some_field", BCON_INT32(4), …
trappedIntoCode
  • 804
  • 8
  • 13
3
votes
1 answer

mongo.h: No such file or directory

I get the mongo-c-driver from official website, as follows: $git https://github.com/mongodb/mongo-c-driver.git $cd mongo-c-driver $./autogen.sh $ make $ sudo make install Deal.c:2:19: fatal error: mongo.h: No such file or directory However,when I…
user2270421
  • 33
  • 1
  • 3
3
votes
0 answers

How can I perform mapreduce on mongoDB C driver?

I would like to perform mapreduce on mongoDB in C driver. However, there is only one way I can successfully achieve the goal. that is, mongo_simple_str_command( conn, "db", "$eval",legalCommand, &b ) Since $eval may block reading and writing…
Ray
  • 568
  • 6
  • 20
2
votes
3 answers

cmake include_directories passed to externaproject_add

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 dependencies as mongo-c-driver/mongo-cxx-driver #…
amigo421
  • 2,429
  • 4
  • 26
  • 55
2
votes
1 answer

MongoDB $regex operator don't work NodeJS using mongoc

I have read the MongoDB documentation and there is a "$regex" operator. I'm currently doing a NodeJS binding for a driver written in C++ that use bsonsearch. I use this code in NodeJS : db.find(bson.serialize({foo: {$regex: new RegExp('.', 'i')}}),…
2
votes
3 answers

How can I resolved Unresolved inclusion: ?

I am a green hands about mongoc. My mongo-c-driver is 1.6.3, and I want to do some operation to mongodb database, like create, update, insert and delete. But there are problems as shown below. My eclipse CDT contains the header file…
Sucy
  • 488
  • 11
  • 19
2
votes
2 answers

Sorting seems doesn't work mongo-delphi-driver

This simple snippet doesn't work, I would like sort the document by name but the documents returned have no order procedure TForm1.Button1Click(Sender: TObject); var cursor : TMongoCursor; begin cursor := TMongoCursor.Create(BSON([])); …
Marco Andreolli
  • 316
  • 5
  • 19
2
votes
1 answer

mongoc driver: how to query based on ISOdate?

I have a simple query that worked on mongodb shell: db.collection.find({"date": {$lt: ISODate("2015-11-03T00:00:00Z")} }) very simple, just trying to find any record that has date before 2015-11-03. Now i want to translate to similar code in mongoc…
dome some
  • 479
  • 7
  • 22
2
votes
3 answers

how to add pkg-config to a Makefile?

My Makefile looks like this : all:main.cpp g++ -I../../DrAPI/ -Wl,--no-as-needed -ldl -lrt -o SampleApp01 $< clean: rm -f SampleApp01 this is what I would do without Makefile: gcc main.cpp -o test $(pkg-config --cflags --libs…
dome some
  • 479
  • 7
  • 22
2
votes
0 answers

Append binary data into a basic document mongocxx c++

I've done some work with the legacy driver and now I'm upgrading to the new one. But I'm stuck with a problem. I'm trying to append a b_binary to a basic document, but bytes is const *uint8_t. So, I can't append variable values, just static. Is…
2
votes
3 answers

mongo-c-driver cannot find libbson

I'm trying to build the mongo-cxx-driver (eventually), and the first step is to build the mongo-c-driver (which requires libbson). I'm running Windows 10 and using Visual Studio 2015 as my compiler. I was able to run CMake and build libbson just…
nathan lachenmyer
  • 5,298
  • 8
  • 36
  • 57
2
votes
1 answer

MongoDB CDriver how to update array object in index N?

i have document that looks like this : { "_id" : ObjectId("5768e43"), "APPID" : { "Number" : 0, }, sessions : [{ id : 111111, "setOID" : { "Number" : 0 }, …
user63898
  • 29,839
  • 85
  • 272
  • 514
2
votes
1 answer

Does order matter in bson_iter_find in mongo c driver

I am using mongo c driver 1.1 with mongo version 3.0. Libbson version 1.1. I am using an iterator to look for certain fields in a document. The following code only works when "fieldA" is above "fieldB" in mongodb. If i change the order…
Ahmed Shahid
  • 284
  • 3
  • 14
2
votes
1 answer

Is there an equivalent of mongo_find_one() in the new Mongo C driver

In the legacy Mongo C driver there was a a function mongo_find_one, which was used to find a single document in a MongoDB server. MONGO_EXPORT int mongo_find_one( mongo *conn, const char *ns, const bson *query,const bson *fields, bson *out ); Is…
Ahmed Shahid
  • 284
  • 3
  • 14
1
2
3
8 9