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

ambiguous << operator in Mongodb C++ driver document builder

I am trying to build a mongodb document using the v3 driver. I am using strings from an array of "char *" pointers but I keep getting an error that says the << operator is ambiguous. The exact error is: item.cpp:105: error: ambiguous overload for…
Bob B
  • 11
  • 2
0
votes
1 answer

find in BSON documents with MongoDB C++ driver

I have the following document in my MongoDB test database: db.a.find() {[ { "_id" : ObjectId("5113d680732fb764c44qweq"), "Builds" : [ { "level" : 1, …
YaroslvaV
  • 85
  • 11
0
votes
2 answers

fin in BSON documents with MongoDB C++ driver

I have the following document in my MongoDB test database: db.a.find() {[ { "_id" : ObjectId("5113d680732fb764c44qweq"), "Builds" : [ { "level" : 1, "rank" : 2 …
YaroslvaV
  • 85
  • 11
0
votes
3 answers

How to set up Visual Studio project settings with mongo-cxx-driver?

I have successfully build the version 3.0.3 of the MongoDB driver for C++ on Windows 10 with CMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver But I don't know how to set up a project in Visual Studio 2015 that can use this driver. I found this post here,…
Shinji Ikari
  • 173
  • 1
  • 12
0
votes
1 answer

what's the correct way to connect to mongodb replica set with connection pool in c++ r3.0.2 driver?

I am upgrading my mongodb c++ client code from legacy driver and 26compat driver to r3.0.2 driver. The scopedconnection pool class is removed now. My question is how to connect to replica set with connection pool. My current code is: //only call it…
Dean Chen
  • 3,800
  • 8
  • 45
  • 70
0
votes
1 answer

Unknown error code bsoncxx::oid

I have a relatively simple example of making an oid with mongocxx driver. It is as follows: try { // assetId is const UInt8 * bsoncxx::oid id = bsoncxx::oid{std::string((const char *)assetId)}; } catch (const std::exception& xcp) { std::cout <<…
Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
0
votes
1 answer

Mongo C++ driver is able to bypass document structure rules (the one about keys not starting with $)

If I try to insert a document in MongoDB with some key starting with $ I get an error message: > db.x.insert({"a": {"$b": "1"}}) 2016-09-29T21:14:23.078+0200 E QUERY [thread1] Error: field names cannot start with $ [$b] : ... (I have observer a…
fgalan
  • 11,732
  • 9
  • 46
  • 89
0
votes
0 answers

Don't see Mongocxx

After installing and adding in eclipse linker mongocxx bsoncxx libs, try compile code #include #include int main(int, char**) { mongocxx::instance inst{}; mongocxx::client…
YaroslvaV
  • 85
  • 11
0
votes
1 answer

mongodb mongocxx C++11 - find_on(): error:

I wrote something like: bsoncxx::document::value filter_document = document{} << "_id" << bsoncxx::oid { strJobID } << finalize; auto retVal = collTasks.find_one( filter_document, mongocxx::options::find…
Cutton Eye
  • 3,207
  • 3
  • 20
  • 39
0
votes
0 answers

How to update array field in C++

I'm iterating on a query results computing an array of float values. Now from C++ I want to add it to the originating record, or, if already present, update it. From Javascript I do something similar to: db.scraps.find({type: {$exists:…
SiliconValley
  • 1,465
  • 17
  • 30
0
votes
1 answer

Ensure standard library linked to boost matches mongo C++ driver's

I want to install MongoDB C++ client. I read in its manual that: On systems offering multiple C++ standard libraries, you must ensure that the standard library linked into boost matches that linked into the driver. My O.S is ubuntu…
kroiz
  • 1,722
  • 1
  • 27
  • 43
0
votes
1 answer

mongodb connection pool with authenticated connections in C++ driver

I've read that the connection pool of the C++ driver doesn't work with authenticated connections (article from end of 2013). Is this (still) true?
kzangeli
  • 403
  • 2
  • 8
0
votes
0 answers

compare_numbers.h:83: warning: passing 'double' for argument 2 to 'int mongo::compareLongs(long long int, long long int)'

I want compile mongo c++ driver in RHEL 5, but when use scons, Error is : compare_numbers.h:83: warning: passing 'double' for argument 2 to 'int mongo::compareLongs(long long int, long long int)' scons: ***…
Hamid Mamdoohi
  • 134
  • 1
  • 9
0
votes
1 answer

Processing MONGO record with nested arrays in C++

I'm trying to use the MONGO C++ API to process a bunch of records that look like the following... The number of lines in the "Entries" array is variable: it's either 13 or 7. { "_id" : ObjectId("541af7a4c9c7450a5a5c7e8e"), "SvId" : "SV120",…
earnric
  • 410
  • 4
  • 15
0
votes
1 answer

Correctly modifying mongo::BSONObj in C++

I have written a software that uses mongodb for data storage. After query has returned data, the BSONObj is used in lot of different places. At the moment I need to add a possibility for C++ side modifications of the BSONObj returned by query. As…
UldisK
  • 1,619
  • 1
  • 17
  • 25
1 2 3
17
18