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" },
…
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…
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…
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…
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…
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…
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…
In my MongoDB database I have documents of this form:
{ "timestamp" : "2012-01-15T17:56:14.85",
"Event" : [
{
"id" : "1851236846",
"qualifier_id" : "209"
},
{
…
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…
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',…
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…
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…
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…