Is there a way to create a bsoncxx::builder::basic::document from a std::string?
I know how to build a document using mongocxx functions such as make_document, kvp, make_array, as well as through the streaming functions.
But what I want to know is…
I'm working with mongodb transactions in c++. The steps I’m performing are the following:
create session
create a bulk_write for this session, where I have
multiple inserts to a collection
start transaction
execute bulk_write
commit…
When attempting to query, a MongoDB Document containing a KVP:
"Cell_Lon": "-105.2"
I try to use a std::string Cell_Lon variable to perform findOne query using the bson streambuilder:
bsoncxx::stdx::optional…
I have a few bson files which i need to insert into the mongodb using c++ code.
Is there any way to insert a bson document into mongodb using mongocxx driver?
I am using ubuntu, and all I could get was to manually create the document inside the…
I have a class that has a bsoncxx::document::view view as a private attribute, and a method that get a document from the Mongo database and save the result in the local bsoncxx::document::value value variable and then get the view from the…
For the past two days I have tried to build and test mongocxx on two different Windows 10 machines, one using VS2015 and the other using VS2017. The builds install without errors (though I had initial issues with ENABLE_EXTRA_ALIGNMENT). However,…
I'm going to build a server, and i have a list containing a struct("_id" is in it), now i want to compare the _id between the exist one in mongodb and the one in instruct.
I've finished the code, and when it comes to compiling, there are two same…
Similarly to how we construct bsoncxx::document::view objects from a buffer with a single binary document, is there a way to extract single documents from a collection in a .bson dump in this framework without having to load them into a DB?
i.e.…
I was attempted to update a few field values of a BSON document using the Mongo C++ driver, but it seems like my implementation using $set does not work properly.
mongo::BSONObj update(mongo::BSONObjBuilder b, mongo::BSONObj bson, int
value)
{
…
The MongoDB C++ driver allows two ways (among others) of creating BSON objects.
Based in stream:
auto builder = bsoncxx::builder::stream::document{};
bsoncxx::document::value doc_value = builder
<< "name" << "MongoDB"
<< "type" << "database"
…
Trying to build mongocxx driver.
I have installed mongoc driver without problems in path c:\mongo-c-driver (ver. 1.14.0).
After running:
cmake.exe -G "Visual Studio 15 2017 Win64"
-DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver
…
I have a mongodb collection with the following document:
{
"_id" : ObjectId("5c879a2f277d8132d6707792"),
"a" : "133",
"b" : "daisy",
"c" : "abc"
}
When I run the following mongocxx code:
auto r =…
I'm trying to build the C driver with Kerberos support, from
mongo-c-driver-1.10.3.tar.gz. I'm on Ubuntu 16.04, 64-bit Intel, with gcc
5.4.0. I run CMake like::
$ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
...
-- Build files have…
I'm having some trouble with the mongodb c++ driver.
I have the following code and it worked fine:
//bsoncxx::document::value doc-->It was defined properly before
static mongocxx::instance inst{};
mongocxx::client conn{ mongocxx::uri{} };
auto db…