Questions tagged [mongo-cxx-driver]

Officially supported C++ driver for MongoDB

The MongoDB C++ Driver is an officially supported driver for MongoDB. It is written in C++11. It wraps the MongoDB C Driver.

More information:

259 questions
2
votes
0 answers

How to convert bsoncxx::array::element to bsoncxx::document::element?

I have a bsoncxx::document::view bsonObj that is a nested BSON document, it contains sub-documents and sub-arrays (an object that contains an array that then again contains a document, etc). When I access a document the returned object is of type…
PlsWork
  • 1,958
  • 1
  • 19
  • 31
2
votes
2 answers

Is there a way for downloading arbitrary ranges from a GridFS collection's file using the mongocxx driver?

I need random access to my files stored in a MongoDB using the GridFS specification. It seems that the C++ driver (mongocxx) doesn't provide an interface for doing that. I can create a mongocxx::gridfs::downloader object from a…
Daniel
  • 311
  • 3
  • 12
2
votes
1 answer

Error connecting mongocxx to mongodb server: SSL support not available

Using mongocxx 3.3 or mongo cxx 3.4 stable versions, I´m trying to connect to a mongo atlas instance. This is my basic code: #include #include mongocxx::instance inst{}; mongocxx::uri uri =…
Federico Caccia
  • 1,817
  • 1
  • 13
  • 33
2
votes
1 answer

Mongo C++ Driver - How to Change Timeout Configurations

How can I change the timeout duration for different operations that can fail due to server inaccessibility? (start_session, insert, find, delete, update, ...) ... auto pool = mongocxx::pool(mongocxx::uri("bad_uri"), pool_options); auto connection =…
pooya13
  • 2,060
  • 2
  • 23
  • 29
2
votes
0 answers

How to set the "contentType" field in GridFS?

I'm writing a RESTful call to save JPEG files in my MongoDB instance. I would like to set the field contentType (mongo documentation) in the document when I upload to the fs.files collection. However I don't see a way to set that field even after…
anon9928175234
  • 105
  • 1
  • 8
2
votes
1 answer

MongoCXX 3.4 - Using a unix domain socket URI

I am trying to connect to MongoDB via the c++ driver. If I provide the IP based URI everything works fine, however when I try to use a unix domain socket URI I get the following error: an invalid MongoDB URI was provided I am trying to connect in…
user3690467
  • 3,049
  • 6
  • 27
  • 54
2
votes
1 answer

Mongocxx fails to connect to mongoDB with SSL

I completed the following tutorial (https://medium.com/@rajanmaharjan/secure-your-mongodb-connections-ssl-tls-92e2addb3c89) to set up self-signed SSL certificates to secure communications between a device and a server hosting a mongoDB database. I…
Nicolas Gaborel
  • 549
  • 1
  • 5
  • 16
2
votes
2 answers

bsoncxx: document::view vs document::value

Please explain the difference between bsoncxx::document::value and bsoncxx::document::view. Is view just a proxy to value class?
jazzandrock
  • 317
  • 2
  • 10
2
votes
0 answers

How to use mongocxx connection from different class or method in QT environment?

As a Scala/Java girl sometimes I am totally losing my mind in C++ / QT. I have very simple thread class like : mongoUpdate::mongoUpdate(QObject *parent) : QObject(parent) { mongocxx::options::client client_options; …
2adnielsenx xx
  • 488
  • 1
  • 5
  • 22
2
votes
1 answer

how convert mongo shell command to mongocxx grammar

db.members.find( {"groupId": 115, userId: { $in: [ 1000, 1001 ] } } ); I find a lot of place, include MongoDB/GitHub. but no use, Who can tell me how to implement this query use c++, thank you very much! as follow can not work: auto members =…
H.He
  • 55
  • 5
2
votes
1 answer

mongocxx crashed in ~client()

I try C++ Driver 3.1.2, the code still crashed in client deconstructor MongoMgr.h #ifndef _MOMGODB_MANAGER_H_ #define _MOMGODB_MANAGER_H_ #include #include #include…
zed
  • 31
  • 5
2
votes
1 answer

c++ serialization to Mongodb

I am trying to use mongodb as my second tier database for my vector matrix in my C++11 code. I have std::vector> object_descriptors; vectors and want to insert each of them to mongodb and read back to std::vector
Rahibe Meryem
  • 269
  • 3
  • 14
2
votes
1 answer

Check if mongocxx collection.create_index() was successful

I am creating an Index in Mongo using mongocxx with this code: auto index_specification = bsoncxx::builder::stream::document{} << "_tablename" << 1 << "rowuuid" << 1 << bsoncxx::builder::stream::finalize; auto result =…
QLands
  • 2,424
  • 5
  • 30
  • 50
2
votes
1 answer

Mongodb c++ driver issue

I am getting an error saying namespace "bsoncxx::v_noabi::builder::basic" has no member "make_document", I have already added required included as per mentioned in the tutorial. I am using mongo-cxx-driver-r3.1.1 version. i have followed example…
Jo Joy
  • 333
  • 2
  • 14
2
votes
1 answer

Extract key attributes mongocxx looping over whole document

Thank you acm for helping me on this, I am still facing few issues as I am new to this I am not getting proper syntax to traverse through the code. I have written code as follows: #include #include…
Shringa Bais
  • 191
  • 2
  • 11
1 2
3
17 18