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
1
vote
0 answers

MongoDB C driver does not return any results for aggregation query

I have following SQL query: SELECT SUM("PAYMENT_HISTORY"."AMOUNT_PAID") FROM "PAYMENT_HISTORY" WHERE (("PAYMENT_HISTORY".YEAR >= 2011) AND ("PAYMENT_HISTORY".YEAR <= 2013) AND ("PAYMENT_HISTORY"."AMOUNT_PAID" >= 500.0)) same SQL after conversion was…
Manish
  • 41
  • 6
1
vote
1 answer

Building MongoDB C++ Driver in Cygwin: generate_error_codes.py not found

I am trying to build the MongoDB client library on Cygwin. Administrator@dev /cygdrive/e/warez/dev-tools/cpp/mongodb-src-r2.4.8 $ scons mongoclient scons: Reading SConscript files ... scons version: 2.3.0 python version: 2 7 5 'final' 0 No special…
figroc
  • 53
  • 7
1
vote
1 answer

Mongo db connect() seg faults in OSX

I recently moved to mac, I am working in a c++ app that uses MongoDB. The code worked in Ubuntu but when I rum it on MAC I get segmentation faults when trying to connect, I do not even get exceptions (which I am catching). The server is up and…
1
vote
1 answer

MongoDB C++ driver server-side Query count

Windows 7 64 SP1 -- MongoDB 2.2.0-rc2 -- Boost 1.42 -- MS VS 2010 Ultimate -- C++ driver I have a function that takes a Query object as a parameter: someFunction( Query qu ) Advantages: Can accept either a Query object or a well-formed…
Therefore
  • 367
  • 2
  • 13
1
vote
2 answers

Query mongodb C

I'm trying to make a query that must to retrieve some data from my mongodb database, follow my code: 72 mongo conn[1]; 73 mongo_cursor cursor[1]; 74 75 //Parameters (connection, IP, port); 76 int status = mongo_connect(conn,…
guisantogui
  • 4,017
  • 9
  • 49
  • 93
1
vote
2 answers

MongoDB retrieve records using $or in C

I'm trying to emulate the following MongoDB shellcode: db.products.find( { $or : [ { title : /blue/i }, { tags : /blue/i } ] }, {_id:0, title:1} ); This is what I've tried: bson query[1]; mongo_cursor cursor[1]; bson_init( query…
Frank Vilea
  • 8,323
  • 20
  • 65
  • 86
0
votes
0 answers

Build mongo-c-driver for 32bit

How to build mongo-c-driver for 32bit linux on a 64bit linux machine using cmake? I'm trying to build it with -DCMAKE_TOOLCHAIN_FILE and all packages are installed with i386. Error when trying to build: /usr/bin/ld:…
0
votes
1 answer

Mongocxx accessing Error from different cpp file

I have created a header mongo.h it contain mongocxx::instance inst{}; mongocxx::uri uri{ "link*****" }; mongocxx::client client{ uri }; i accessed the mongodb from main.cpp by including this mongo.h but when including this header to other cpp file…
VIVEK A
  • 27
  • 6
0
votes
0 answers

Linking MongoDB CXX driver with Qt app project

Our team is stuck on a problem with connecting MongoDB CXX driver to QtCreator 5.10. We have builded and compiled mongo-c-driver and mongo-cxx-driver with CMake and msbuild (VS 2017 compiler). We created test project in Visual Studio added needed…
A. Ko
  • 1
  • 3
0
votes
0 answers

mongoLab C driver authentication and Basic Example

I am trying to interface Official C driver with mongoLab but getting error that failed to authenticate credentials. Do anyone have any simple example on how to interface mongolab using C driver. This is my example code const char* String_uri =…
Saad Saadi
  • 1,031
  • 10
  • 26
0
votes
1 answer

MongoDB BSON OID Failure

I'm using the MongoDB C library to insert documents into various collections within the same database and I'm getting the referenced error repeatedly (along with a lovely see fault) when calling BSON_APPEND_OID (doc, "_id", &oid); I had wanted to…
Davidgs
  • 411
  • 6
  • 18
0
votes
1 answer

Store C structure into MongoDB

I would like to store C struct as a part of document into MongoDB database. For example, struct looks like: typedef struct student { int employee; char name[50]; unsigned char status; int totmarks; } I would like to add two…
Dayakar
  • 11
  • 2
0
votes
1 answer

will bson_oid_init (&oid, NULL) generate the same two _id?

Now, I am using mongodb c driver to insert documents to mongodb. Each time, I used the following codes to generate an _id. bson_oid_init (&oid, NULL); BSON_APPEND_OID (doc, "_id", &oid); If multiple applications run the above codes at the same…
BAE
  • 8,550
  • 22
  • 88
  • 171
0
votes
1 answer

Can MongoDB push data to MS-SQL

I have a requirement where mongodb needs to push its data to MS-SQL server once in a day. I dont want to use java in the middle. Is there a way that MongoDB can it call MS-SQL stored procedure. Any help on this regard is highly appreciated
0
votes
1 answer

MongoDB using $or and $and in new C driver

I'm trying to emulate the following MongoDB shellcode: db.collection.find( { $and: [ { $or: [ { document: { field: "X" } }, { field: "X" } ] }, { _id: ObjectId("X") } ] } ); This is what I've tried (with new MongoDB-C-Driver): bson_init(&query); …
John S
  • 231
  • 3
  • 11