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…
I have the following document in my MongoDB test database:
db.a.find()
{[ {
"_id" : ObjectId("5113d680732fb764c44qweq"),
"Builds" : [
{
"level" : 1,
"rank" : 2
…
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,…
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…
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 <<…
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…
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:…
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…
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: ***…
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",…
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…