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

mongo-cxx-driver library builds but persistent linking and debug issues

I'm trying to build the mongo-cxx-driver for use with Cinder on Windows 10 with Visual Studio 2015. Cinder uses Boost 1.58, so I built the driver against their included version of Boost. I tried to follow the instructions exactly as described on…
nathan lachenmyer
  • 5,298
  • 8
  • 36
  • 57
2
votes
2 answers

Error when building mongocxx driver on Windows

I am trying to follow this guide, and I am currently at step 3. So after running, curl -OL https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.1.tar.gz tar -xzf r3.0.1.tar.gz cd mongo-cxx-driver-r3.0.1/ I try to do similar commands as in the…
Slug Pue
  • 256
  • 1
  • 2
  • 15
2
votes
1 answer

MongoDB C++ tutorial program fails: 'mongocxx::v_noabi::logic_error'

Im trying to get something done with C++ and MongoDB. So far there has been myriad of problems, but I have pulled through. Then I got this one: terminate called after throwing an instance of 'mongocxx::v_noabi::logic_error' what(): invalid use…
Ankk4
  • 31
  • 1
  • 6
2
votes
3 answers

mongo-c-driver cannot find libbson

I'm trying to build the mongo-cxx-driver (eventually), and the first step is to build the mongo-c-driver (which requires libbson). I'm running Windows 10 and using Visual Studio 2015 as my compiler. I was able to run CMake and build libbson just…
nathan lachenmyer
  • 5,298
  • 8
  • 36
  • 57
2
votes
1 answer

Clion mongodb dependency setup

I am getting the following error: --Configuring incomplete, errors occurred! CMake Error: The following variables are used in this project, but they are set to NOTFOUND. See also…
C Guy
  • 48
  • 4
2
votes
1 answer

BSON types and std::chrono

In attempting to work through the official MongoDB C++ tutorial, I've run into an error I don't understand. The following code is pulled right from their website: #include #include #include…
pdm
  • 1,027
  • 1
  • 9
  • 24
2
votes
1 answer

Unset Document::element, MongoCXX Find Option Projection

Following is the code trying to use mongo query with project find option. using bsoncxx::builder::stream::document; mongocxx::options::find opts; document condition, options; const static int readdomain = 90000; condition <<…
Leo Zhao
  • 77
  • 1
  • 12
2
votes
0 answers

SIGSEGV (Segmentation fault) when link boost-thread and boost-regex via cmake

I try compile and run example of mongo-cxx-driver. It requires linking Boost-system, boost-thread and boost-regex. When I compile by commad line: g++ simple_client_demo.cpp -I/home/ssi/mongo-client-install/include…
2
votes
2 answers

MongoDb creating sparse index using c++ driver

Is there a way to create a sparse index using the MongoDb (2.2) C++ driver? It seems that the ensureIndex function does not accept this argument. From MongoDb docs: bool mongo::DBClientWithCommands::ensureIndex( const…
Xyand
  • 4,470
  • 4
  • 36
  • 63
1
vote
1 answer

mongocxx mongosh db.currentOp BSONError: Invalid UTF-8 string in BSON document

I use debian9 and debian10 mongocxx driver to insert data in mongodb 6.0. Then I use mongosh 1.6 for monitoring ops with db.currentOp. And I get an error BSONError: Invalid UTF-8 string in BSON document. I can switch on profiling and look for ops…
1
vote
3 answers

bsoncxx subarray and subdocument builders

I'm attempting to build a document that looks like this: { "Name" : "Joe", "Age" : 34, "Some Array" : [ { "index" : 1, "Some Var" : 12, "Flag" : false }, { "index" : 2, "Some Var" : 13, "Flag" : true }, { "index" : 3, "Some…
1
vote
1 answer

Building a BSON filter from raw query string

Is it possible to create a collection filter from a raw query string? If so, how? I'm using the mongocxx driver and want to use some tested queries from the mongo shell instead of building them inconveniently with that BSONCXX streambuilder. But I…
da-chiller
  • 156
  • 1
  • 13
1
vote
3 answers

Mongocxx - Update an array within a document?

I have a document in MongoDB with the following structure: { "_id":"$oid":"621fbaeaeedd1c000e60fbd2"}, "username":"myuser", "password":"mypassword", "comments":["comment1", "comment2", "comment3"] } I have a vector of…
Vermouth
  • 21
  • 2
1
vote
1 answer

mongocxx: How to filter documents by a field that is a member of another field/object?

In MongoDB Compass, if I filter with the following: {'obj1.obj2.str': "thirteen"} It retrieves successfully, every document that has obj1, and inside of obj1, obj2, and within obj2, a field called str, whose value is equal to "thirteen". In…
1
vote
0 answers

mongo-cxx-client linux unwanted "v_noabi" subdirectory

after installing the mongo-cxx-driver from source as described on their homepage (http://mongocxx.org/mongocxx-v3/installation/linux/) on my debian machine, the installation directory results in: "/usr/local/include/mongocxx/v_noabi/mongocxx" The…
Quirynn
  • 26
  • 2