So, I am running my mongod replica set instances on docker. I am trying to establish the connection from my c++ application. Here is my docker-compose file.
version: '3'
services:
api:
hostname: api
build: .
ports:
…
I'm trying to install the mongo-c-driver and mongo-cxx-driver in a Docker image, but when I run my C++ program it throws a Segmentation fault. Any ideas? Valgrind says it's mongo's fault.
I have some IOT devices and in my own computer they run just…
I'm trying to build mongo-cxx-driver on Windows; I'm following the instructions, but am getting errors:
C1189 #error: "Cannot find a valid polyfill for make_unique"
Here's what I did:
Building mongo-c-driver
I cloned mongo-c-driver using the…
I installed Mongo C++ Driver using following shell script,
#!/bin/bash
echo "Building MongoDB Core Dependency"
cd /home &&
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.17.0/mongo-c-driver-1.17.0.tar.gz &&
tar xzf…
I am working with mongocxx 3.6.0 driver, I try to store and receive bytes from gridfs.
I am able to run the example code in https://github.com/mongodb/mongo-cxx-driver/blob/releases/stable/examples/mongocxx/gridfs.cpp, but I want to search and get…
When trying to connect to AWS DocumentDB using mongocxx C++ driver, even after using the AWS combined pem file as a URI parameter (CA file), I get the below error of TLS handshake failed.
No suitable servers found (`serverSelectionTryOnce` set):…
I am trying to install mongo-c-driver there follow by http://mongoc.org/libmongoc/1.14.0/installing.html. Snce I don't have the root permission, I ran the following:
$ wget…
I'm using the mongocxx (v3) driver in my project to store the app settings in the mongodb. While working in windows everything seems to work well. But now that i'm testing in linux i have noticed some problems that i cannot understand why are…
I'm using MongoDB C++ driver (version 3.4.0 for reference). I need to get the _id of a given document. First, I grab the document:
bsoncxx::stdx::optional sub = conn["mydb"]["csubs"].find_one(...);
so I can access to the…
I want to create and run a query using MongoDB C++ api having these conditions :
timestamp is within a range AND
From an array of strings, atleast one of them to be equal to the type
I have these fields in my MongoDB document:
id_, timestamp,…
I have proto message which is stored in mongo as string with below syntax
data.toByteString().toStringUtf8();
Which is nothing but unicode encoded as utf8.
Now i am trying to read the same in c++ side from mongo using below -
std::wstring…
I have the following function that gets a value out of a BSON document when given a sequence of keys:
bsoncxx::document::element deepFieldAccess(bsoncxx::document::view bsonObj, const std::vector& path) {
if (path.empty())
…
I have a bsoncxx::document::view bsonObjViewand a std::vector path that represents keys to the value we are searching for in the BSON document (first key is top level, second key is depth 1, third key depth 2, etc).
I'm trying to write…