I'm using mongoc library in ANSI C code. I'm new with mongoc API and I have problem in creating query. Following code throws assertion src/bson/bcon.c:807: bcon_append_ctx_va: Assertion `ctx->n != 0' failed. Can someone help?
bool…
When I try to use libmongoc, I get a segfault at
client = mongoc_client_new ("mongodb://localhost:27017");
GDB results:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7970d79 in _mongoc_client_new_from_uri () from…
I am using MongoDB with the c-client, mongoc 1.8.1.
I am performing a bulk update, with 6 mongoc_bulk_operation_update_one() operations. However, for 3 of the updates the selection document does not match anything in the database (say…
I'm trying to connect mongdb with mongocxx driver in my C++ sample code. I added Additional include, Libraries and dependencies. When I build it it shows following error.
this is the full code
#include "stdafx.h"
#include
#include…
How can we replace a document in MongoDB using Mongo C Driver?
Are there any APIs available?. In Mongo shell I can use replaceOne for this purpose.
But how can I do this through my C program?
I am attempting to remove a value from multiple arrays without having to issue multiple Mongo commands. I must have my syntax incorrect, any help would be appreciated.
When I try:
update = BCON_NEW("$pull",
"{",
…
I'am trying to compile mongo-c-driver from this link regarding to described in this link.
I have compiled libbson successfulty, when i try to below command I get The source directory "/" does not appear to contain CMakeLists.txt.
cmake -G "Visual…
I am having trouble with correct format of authenticating code. According to http://mongoc.org/libmongoc/current/authentication.html,
authenticate code is
mongoc_client_t *client = mongoc_client_new…
I have to perform a query on mongodb, i would like select only a document has a particular _id (type ObjectId).
I use "Strict mode" sintax and in particular the operator $oid for compare _id with a string.
But it doesn't work!, I don't now if it is…
I have a C script that parse some data and put the data into mongodb using mongoc driver. The script use multithreading to open 3 threads at the same time. The very first time it worked without problem, but somehow I lost data and had to rerun the…
I'm using monoc 1.2.0 successfully,
I'm now trying to add an SSL enabled connection in a two of modes:
Only require SSL no certificate check
Provide certificate and verify it including hostname
For 1 I get segmentation fault:
#0 0x00002ac83368e3c8…
I want to do bulk insert for many threads at the same time, each time each thread insert data into different collections. I know it's not thread safe if I put all data into one collection, but what if each thread insert data into a totally different…
I have documents in a mongo collection which look like:
{ "f" : [ 283, 180, 284 ], "l":["1","29"] }
I am using the mongoDB c driver to fetch these documents and perform some operations on these> I would like to restore element "f" back as an array…
i try to find way in C Driver to somthing that is similar to :
https://docs.mongodb.com/manual/reference/operator/query/elemMatch/#op._S_elemMatch
as answerd in this thread :
Query for a field in an object in array with Mongo?
i have this json and…