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
1
vote
1 answer

how to get `_id` after upserting document in mongo-c-driver or mongo-cxx-driver?

How to get _id after upserting document in mongo-c-driver Or mongo-cxx-driver? The following code snippet is from mongo-shell, Which shows the _id field in last row of WriteResult. db.coll.update( { item: "ZZZ135" }, …
twid
  • 6,368
  • 4
  • 32
  • 50
1
vote
0 answers

Timeout retrieving document

Sometimes we get this error message when trying to get a specific document: System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period…
Kai-Rune
  • 462
  • 6
  • 17
1
vote
1 answer

bson init from json string with $inc operator

I wanna update a document with such a updator(s json string): {"$inc": {"ref": 1}} And I'm using libbson to construct a bson object from that,while the bson_new_from_json always failed.However,the $set operator is ok,what's wrong with the $inc…
rpbear
  • 640
  • 7
  • 15
1
vote
1 answer

Error linking to mongo-c-driver library while building collected performance monitoring package

I am trying to build the collectd system performance monitoring package (version 5.4.1; building collectd on Fedora v20 VM) and want to use the write_mongodb plug-in. I run ./configure in the folder collectd-5.4.1 where I have download the package…
Sid Thakur
  • 798
  • 1
  • 7
  • 10
1
vote
1 answer

How to reference a document in Mongodb Using MongodbRef and How to get combined document

Hi I am new to Mongo db I have class structure like this for storing smilies and smilies category. I have made a mongodef property in smilies class for referencing smilies category collection but enable to get smilies category name... public class…
1
vote
2 answers

MongoDB C++ Driver - Unresolved External Symbol

I'm trying to run the example program for the MongoDB C++ Driver so I can run some tests, and have come across some errors that I'm stuck on. Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall…
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
0 answers

How can I use the mongo_run_command function to rename a collection of MongoDB in C?

I'm trying to rename a collection in a C program but this don't work: commandData = (bson *) malloc(sizeof(bson)); commandOut = (bson *) malloc(sizeof(bson)); int…
APM
  • 11
  • 2
1
vote
1 answer

Assertion: 13111:wrong type for field 3 != 4 - MongoDB C++ driver

In my MongoDB database I have documents of this form: { "timestamp" : "2012-01-15T17:56:14.85", "Event" : [ { "id" : "1851236846", "qualifier_id" : "209" }, { …
1
vote
2 answers

Compiling Mongo c driver example program

I am beginning to learn about using the mongo-c-driver, but I have been having compilation issues when I run gcc -g -Wall -Werror -Isrc --std=c99 mongo-c-driver/src/*.c -I mongo-c-driver/src/ intro.c -lmongoc I have already looked over the other…
user1876508
  • 12,864
  • 21
  • 68
  • 105
0
votes
0 answers

MongoDB using C- Find a document based on a key value pair where key is of type array in mongodb document

I have to read a document from mongodb such that the field on which I want to apply the search is an array. Example: Say db contains: [ { _id: ObjectId("6476d33e8258c0b6563324b4"), tag: ['a1', 'a2' , 'a3'], age : 21, val: [ '101',…
0
votes
1 answer

$geoNear, $near, and $nearSphere are not allowed in this context error with Mongo C driver

I'm using the mongoc_collection_count_documents() function (driver version 1.23.1, MongoDB server version 5.0.13), this way: long long n = mongoc_collection_count_documents(collection, q, NULL, NULL, NULL, &error); where q is a bson_t variable that…
fgalan
  • 11,732
  • 9
  • 46
  • 89
0
votes
0 answers

Ubuntu Qt Cross Compiling: libmongocxx.so file is not recognized

Host: Ubuntu 22.04.1 LTS x64_86 Target: Raspberry Pi 4B Raspbian 10 (buster) 32bits Qt Version: 5.15.7 MongoC and MongoCXX libraries built from source on both Host and Target. Checked libraries files and they are present in their locations (both…
0
votes
0 answers

how to extract the raw value in a subdocument in mongo's libbson c library?

consider the mongo document: {"key1": "value1", "key2": {"subkey1": "subvalue1"}}, this can be encoded (using python bson module like: bson.encode(DATA)) to the following uint8_t array: [56, 0, 0, 0, 2, 107, 101, 121, 49, 0, 7, 0, 0, 0, 118, 97,…
yuser099881232
  • 311
  • 1
  • 11
0
votes
2 answers

MongoDB C driver gives strange error about OpenSSL while installing

While I'm trying to install MongoDB C driver via CMake, at compilation process it gives error that says; libmongoc-1.0.so.0.0.0: undefined reference to "OSSL_HTTP_parse_url" libmongoc-1.0.so.0.0.0: undefined reference to…
Emre
  • 15
  • 6
1 2 3
8 9