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

Mongo C++ driver Ver 3.3.1 and Mongo C Driver compatibility?

The page about the latest version of C++ Driver says: Please note that this version of mongocxx requires the MongoDB C driver 1.10.1. Should I get this literally? I'm asking because the latest version of C Driver is 1.13.0... should I rollback to…
HEKTO
  • 3,876
  • 2
  • 24
  • 45
1
vote
0 answers

mongocxx crash when doing many inserts & catching exceptions in underlying C driver

I have a C++ application which is processing JSON and inserting into DB. It's doing a pretty simple insert, parses the JSON adds a couple of fields and inserts as below. I have also surrounded the call with a try/catch to handle any exceptions that…
Chris
  • 33
  • 1
  • 5
1
vote
0 answers

(SSL)windows secure Channel doesn't allow pemkeyfile has password

if I compile the c driver with -DENABLE_SSL=WINDOWS (windows secure Channel), connection would be failed if the client pem key file has password. the error info of log: [error@stream-secure-channel] Failed to parse private key. ASN1 bad tag…
1
vote
1 answer

C++ How to link mongoc and mongocxx static library using CMakeList.txt

I follow the official tutorial for the installation : https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/ I've enabled the flag --enable-static=yes with the ./configure before doing make && sudo make install and I got the…
Ashwin PRJ
  • 51
  • 2
  • 7
1
vote
0 answers

vc++ community edition mongo db driver

I'mm trying to build mongocxx driver for vc++ 2017 community edition. I ran below and got errors and retargetted to latest build tools and got successfully compiled. cd mongo-c-driver-1.8.0\src\libbson cmake -G "Visual Studio 14 2015 Win64" \ …
Curious
  • 921
  • 1
  • 9
  • 25
1
vote
1 answer

mongo c driver: how to query documents with "_id" in a list?

I have a db with huge amount of documents, and I only want to query documents with "_id" from a list. I searched online for a few hours, and did not find anything really working, so I post my question here. Thank you very much for any help! in…
Johnson
  • 121
  • 10
1
vote
1 answer

bson-append_double with double precision

I got a problem with function bson_append_double below: dvalue = 0.01; bson_append_double(pbson, field_name, -1,(double)dvalue); but the result i got is annoying long: 0.0099999997764825820923 Did anyone faced this problem before, please help…
1
vote
1 answer

How can I create an OID from time

In pymongo you can do something like this to create an OID from time: dummy_id = ObjectId.from_datetime(time) Is there something like that in mongoc? I saw that there's a "bson_oid_get_time_t()" function, but is there a reverse function of this,…
cydan
  • 615
  • 5
  • 17
1
vote
2 answers

mongo c-driver bcon $ne value no equal

I am trying to append a requirement to my BCON query where 'tribe_type' does not equal 'initial-public'. My original code was and that worked: query = BCON_NEW ("_id", BCON_OID(&oid)); When I add the second part, it compiles, however the mongo…
Steven Carlson
  • 925
  • 1
  • 10
  • 25
1
vote
1 answer

Mongocxx in Windows LNK2001: unresolved external symbol __imp_mongoc_read_prefs_new

I have followed the instructions in the following document to the letter (including the instructions for building mongo-c-driver): https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/ I am attempting to build the sample code provided…
castro
  • 409
  • 3
  • 13
1
vote
1 answer

Mongo C# Driver - GeoJson Polygon to GeoJsonLinearRingCoordinates

I'm new to the Mongo C# driver and I'm trying to create a intersect query in C#. I have the function working in Javascript but I'm struggling with some of the classes in the Mongo driver. At the moment I have the GeoJson pulling fine but when I…
Lereveme
  • 1,614
  • 2
  • 15
  • 18
1
vote
0 answers

Fail Combine Multiple Nested Queries with MongoDB C+11 Driver

error: invalid operands to binary expression ('key_context > >' and 'bsoncxx::v_noabi::builder::stream::document') open_document << conditionI << close_document << ~~~~~~~~~~~~~ ^ ~~~~~~~~~~ using…
Leo Zhao
  • 77
  • 1
  • 12
1
vote
1 answer

Using c# Mongodb driver 2.2, how to find max record when grouped by on a particular field

I have a collection as "UserRecords". structure for this is as follows { "_id" : "ee654ce6-e50d-4243-8738-35c087a85e67", "_t" : "Animals", "ClickedOn" : NumberLong(1452600122), "Category" : "Nature", "UserId" : "a1", …
Learner
  • 1,277
  • 3
  • 15
  • 34
1
vote
1 answer

Get a cursor for an entire collection with mongo c driver

I am using mongo c driver 1.1 with mongo version 3.0. I need to write a function that gets a cursor to a collection. I found the following example in the documentation. http://api.mongodb.org/c/1.1.0/mongoc_cursor_t.html collection =…
Ahmed Shahid
  • 284
  • 3
  • 14
1
vote
1 answer

How to construct a URI with username password for mongo C driver.

I am using mongo 3.0.8. I have an authenticated user admin with password admin. I am able to connect to the mongo shell as follows. mongo admin -u amdin -p amdin However, i tried to connect to using the following C code. This gives me an…
Ahmed Shahid
  • 284
  • 3
  • 14
1 2 3
8 9