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
0 answers

mongodb v3 driver vc++ community addition linker errors

I'm getting the following linker errors in types.hpp while compiling in vc++ 2017. How shall i solve them ? Below is the code I'm tyring to compile in vc++. Additional directories…
Curious
  • 921
  • 1
  • 9
  • 25
0
votes
1 answer

How to append GUID as bsoncxx::types::b_oid to document using mongocxx driver?

I've done some work with the legacy driver and now I'm upgrading to the new one. But I'm stuck with a problem. I'm trying to append a GUID to a basic document, but in new driver only 12 byte length binary data is allowed. In legacy driver, it…
snb
  • 633
  • 1
  • 6
  • 13
0
votes
0 answers

bsonxx::from_json convert all value types to string

I am using Boost's Property Tree library for storing my json files. For example, I have the following JSON file: { "var" : true, "bar" : -1.56 } Next I parse this file to ptree object, do my job and want to store output in MongoDB. For…
Serbin
  • 803
  • 12
  • 27
0
votes
1 answer

Which mongoDB ODM for C++?

I have recently started developing a project using C++11 and MongoDb, although i have successfully used mongocxx driver to implement the logic, but it takes some time to desiralize the data. mongocxx::options::find…
Nirmal Vatsyayan
  • 384
  • 1
  • 5
  • 20
0
votes
1 answer

Faster way to get data out of mongo results than field-by-field?

Is there a faster way to parse mongo results back into datastructures than doing it field-by-field as below? I'm currently doing this and it's very slow. mongocxx::cursor cursor = m_coll.find(); for (bsoncxx::document::view doc :…
Carbon
  • 3,828
  • 3
  • 24
  • 51
0
votes
1 answer

MongoCXX - handling a cursor from distinct

I think it should be fairly obvious what I'm trying to do here - query a collection m_coll, and get all unique values of Density from that collection. However, the thing it's returning is an element, not a full document, so you can't seem to key it,…
Carbon
  • 3,828
  • 3
  • 24
  • 51
0
votes
1 answer

Mongodb C++ compilation issue

I am trying to compile mongodb driver for c++ and following instructions given in url : Mongocxx I am getting below errors : -- The CXX compiler identification is GNU 4.8.5 -- Check for working CXX compiler: /bin/c++ -- Check for working CXX…
Nirmal Vatsyayan
  • 384
  • 1
  • 5
  • 20
0
votes
1 answer

Mongodb Cxx Driver Test crashing in Release Build [ Works fine in Debug ]

I have build the mongodb cxx binaries in windows following the steps described here. I have created the Test application as mentioned in the steps. On release builds, the application throws bad allocation exception: std::bad_alloc at memory location…
snb
  • 633
  • 1
  • 6
  • 13
0
votes
1 answer

Generating Visual Studio 2017 projects with CMake

I tried to build Mongo C++11 drivers for use in my project. The Mongo drivers compiles fine. Instruction on using them insist that when using for own project the following piece of code should also be part of the .vcxproj of my project (if one use…
Amani
  • 16,245
  • 29
  • 103
  • 153
0
votes
1 answer

mongo-cxx-driver installation does install libraries

I am trying to compile mongo-cxx-driver-r3.1.1 on Ubuntu14.4 . I have installed mongo-c-driver-1.6.3 from source as per instructions. pkg-config --cflags --libs libmongoc-1.0 libbson-1.0 returns -I/usr/local/include/libmongoc-1.0…
0
votes
2 answers

C++ executable keep looking for ordinal entry point

I have a C++ application with the below source code: #include #include #include #include #include #include #include #include…
Amani
  • 16,245
  • 29
  • 103
  • 153
0
votes
1 answer

cxx MongoDB group with multiple id

Sample data is like below . { "_id" : 1, "item" : "abc", "price" : 10, "quantity" : 2, "date" : ISODate("2014-03-01T08:00:00Z") } { "_id" : 2, "item" : "jkl", "price" : 20, "quantity" : 1, "date" : ISODate("2014-03-01T09:00:00Z") } { "_id" : 3,…
0
votes
0 answers

mongodb C++11 bsoncxx find() member can't return correct result

I have some difficulties calling find() to query document. I insert two records to database here is the pic of database { "_id": ObjectId("58f21ae56d79a41a895c9c72"), "userID": NumberInt(100), "firendId": NumberInt(333), …
Ti Lami
  • 9
  • 2
0
votes
0 answers

mongodb and ubuntu server keeps crashing

I have a C script that parse some data and put the data into mongodb using mongoc driver. The script use multithreading to open 3 threads at the same time. The very first time it worked without problem, but somehow I lost data and had to rerun the…
dome some
  • 479
  • 7
  • 22
0
votes
1 answer

Mongodb C++ Driver and GridFS support

I want to access GridFS from my C++ application. I found that there are two C++ APIs for MongoDB: a modern mongocxx-3 and a legacy mongocxx-1. Mongocxx-1 contains some classes to work with GridFS (like GridFile), but the modern API does not. Is…
Borisko
  • 358
  • 1
  • 5