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

What is "JavaScript with Scope" in MongoDB

In the following link https://docs.mongodb.com/manual/reference/bson-types/ It mentions JavaScript with Scope is a possible data type in documents. My questions are: (1) What is a JaveScript with scope? (2) Is it some kind of "Internal" data types…
Chang Su
  • 81
  • 2
6
votes
1 answer

cannot compile mongo-c-driver example

I try to write simple mongo c client. Source file (a.c): #include #define MONGO_HAVE_STDINT #include void mongo_init_c(mongo *con) { mongo_init(con); } int main() { return 0; } And i try to compile it with: gcc…
user1312837
  • 1,268
  • 1
  • 11
  • 29
5
votes
1 answer

Dynamic Linq Predicate throws "Unsupported Filter" error with C# MongoDB Driver

I have been trying to pass in a dynamic list of Expressions to a MongoDB C# Driver query using Linq ... This method works for me with regular Linq queries against an ORM, for example, but results in an error when applied to a MongoDB query ... (FYI:…
Gary O. Stenstrom
  • 2,284
  • 9
  • 38
  • 59
5
votes
0 answers

Error handling in mongo C driver 1.2.0

Is there a way of handling connection Errors in the new mongo C library. In older version's of the driver (legacy), the old versions of the driver gave error codes on calling functions to access Mongo, for example MONGO_CONN_FAIL, MONGO_NS_INVALID.…
Ahmed Shahid
  • 284
  • 3
  • 14
5
votes
3 answers

Regex in MongoC

How can I do this query in mongoC with bcon_new? db.users.find({"name": /.*m.*/})
Faruk
  • 5,438
  • 3
  • 30
  • 46
4
votes
3 answers

Get data between two dates mongoDb using C Driver

i inserted data like this { "userid" : "manaf", "DataValue" : { "$type" : "00", "$binary" : "sampleBinaryData" }, "timestamp" : 1460718961132, "_id" : { "$oid" : "5710cd7194e5f57831eea91e" }, "__v" : 0 } i need to get the…
Abdul Manaf
  • 4,933
  • 8
  • 51
  • 95
3
votes
1 answer

Problems building mongo-c-driver-1.16.2 for Win64

I need to compile the MongoDB driver for windows x64 (.dll extension). I was following this tutorial with visual studio 16 2019 and cmake 3.17.0, but I found several problems: First step is: $ cd mongo-c-driver-x.y.z $ mkdir cmake-build $ cd…
Héctor
  • 399
  • 3
  • 16
3
votes
0 answers

Can't connect with SSL/TLS to mongodb

I'm trying to connect through SSL to a local mongodb instance through libmongoc. The connection works just fine if I don't use SSL, and I can do CRUD operations normally, but when I enable SSL and try to retrieve some data, the mongoc_cursor_next()…
Tyras
  • 103
  • 1
  • 7
3
votes
2 answers

Can't find mongoc.h

I can't find mongoc.h after installing Mongodb and C driver on Ubuntu 16.04. sudo apt-get install mongodb sudo apt-get install libmongoc-1.0-0 sudo apt-get install libbson-1.0 This is the error I get: gcc -o mtest mtest.c…
RR1
  • 333
  • 1
  • 6
  • 13
3
votes
2 answers

Installing Mongo c and c++ drivers in Docker

I'm attempting to install the mongocxx driver in a Docker container, and step number one is to install the mongo-c driver using package manager. My slimmed down Dockerfile: FROM phusion/baseimage:latest RUN apt-get install -y libmongoc-1.0-0 After…
Nate Roiger
  • 325
  • 2
  • 7
3
votes
1 answer

mongo c driver update nested array

I am trying to use the mongo c driver to update a nested array inside of a single document. Here is an example test document: { "_id" : ObjectId("562416504bacd3940b8b2d5c"), "folder1" : [ { "folder_id" : "5624200d4bacd3940b8b2d62",…
Steven Carlson
  • 925
  • 1
  • 10
  • 25
3
votes
2 answers

mongo c driver install issue : test.c error: mongoc.h: No such file or directory

== installed: mongo-c-driver-1.1.0 /usr/src/mongo-c-driver-1.1.0/src/mongoc issue : header file is in same direcroty still not getting . ===== mongo c driver install issue : test.c error: mongoc.h: No such file or directory root@webrtc mongoc]#…
3
votes
1 answer

Sort Subcollection and Return First Subcollection Document

I have a collection with documents that look like this: { "_id": ObjectId("507f191e810c19729de860ea"), "SubCollection": [{ "_id": ObjectId("55849c0002cee826cc67550a"), "Timestamp": NumberLong(635717988841453845), …
Nicholas J. Markkula
  • 1,542
  • 4
  • 18
  • 30
3
votes
1 answer

Sorting by Subfields in Mongo C-Driver

We are trying to create a query in order to programmatically get an ordered cursor of a collection. There is a single example given in mongodb website and it is not even a working one. What we are trying to do is to sort our collection by two fields…
Can Bayar
  • 497
  • 4
  • 16
3
votes
1 answer

c - accessing value.type when iterating bson

I am trying to follow the libbson API documentation. But it seems I got something wrong. The documentation states you can do: const bson_value_t *value; value = bson_iter_value (&iter); if (value.type == BSON_TYPE_INT32) { printf ("%d\n",…
oz123
  • 27,559
  • 27
  • 125
  • 187
1
2 3
8 9