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…
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…
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 =…
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 =…
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…
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…
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…
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;
…
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 =…
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…
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
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 =…
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…
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…