mongo-cxx-driver

Building mongo-cxx-driver using CMake ExternalProject_Add

血红的双手。 提交于 2021-02-04 06:13:14
问题 I am trying to build mongo-cxx-driver in a CMake based project. This project is supposed to build on Windows, macOS and in an ubuntu container and I want to ensure that my software on all these platforms will use the same driver version so I cannot afford installing the driver and its dependencies via apt-get , brew etc. So I am left with one option: ExternalProject_Add . But I am having difficulty making that work given how libmongoc is setup. Below is the CMake module I currently have.

Building mongo-cxx-driver using CMake ExternalProject_Add

眉间皱痕 提交于 2021-02-04 06:10:34
问题 I am trying to build mongo-cxx-driver in a CMake based project. This project is supposed to build on Windows, macOS and in an ubuntu container and I want to ensure that my software on all these platforms will use the same driver version so I cannot afford installing the driver and its dependencies via apt-get , brew etc. So I am left with one option: ExternalProject_Add . But I am having difficulty making that work given how libmongoc is setup. Below is the CMake module I currently have.

Building mongo-cxx-driver using CMake ExternalProject_Add

天大地大妈咪最大 提交于 2021-02-04 06:10:01
问题 I am trying to build mongo-cxx-driver in a CMake based project. This project is supposed to build on Windows, macOS and in an ubuntu container and I want to ensure that my software on all these platforms will use the same driver version so I cannot afford installing the driver and its dependencies via apt-get , brew etc. So I am left with one option: ExternalProject_Add . But I am having difficulty making that work given how libmongoc is setup. Below is the CMake module I currently have.

Building mongo-cxx-driver using CMake ExternalProject_Add

喜你入骨 提交于 2021-02-04 06:08:28
问题 I am trying to build mongo-cxx-driver in a CMake based project. This project is supposed to build on Windows, macOS and in an ubuntu container and I want to ensure that my software on all these platforms will use the same driver version so I cannot afford installing the driver and its dependencies via apt-get , brew etc. So I am left with one option: ExternalProject_Add . But I am having difficulty making that work given how libmongoc is setup. Below is the CMake module I currently have.

Mongocxx array of ObjectID in find

折月煮酒 提交于 2021-01-28 07:38:35
问题 I'm trying to populate a query for a C++ using mongocxx driver. The query in Javascript would be like: {unit_id: {$in: [ObjectId('58aee90fefb6f7d46d26de72'), ObjectId('58aee90fefb6f7d46d26de73'] } } I was thinking that the following code could work to generate the array part, but it doesn't compile. #include <cstdint> #include <iostream> #include <vector> #include <bsoncxx/json.hpp> #include <bsoncxx/types.hpp> #include <mongocxx/client.hpp> #include <mongocxx/stdx.hpp> #include <mongocxx/uri

New C++ Mongo driver: how to see type and how to get string value

可紊 提交于 2020-02-21 11:57:44
问题 I've got two questions that I cannot find an answer for in the tutorial. I get a document and then an element from the doc like this: bsoncxx::document::element e = doc["id"]; if (!e || e.type() != bsoncxx::type::k_int32) return ERROR; int id = e.get_int32(); Is there a way to get a string value for the type, for debugging purposes? Like: std::cout << e.type() << std::endl; (which doesn't work) The second question is how to convert the utf8 type value into a std::string. This doesn't work: e

New C++ Mongo driver: how to see type and how to get string value

这一生的挚爱 提交于 2020-02-21 11:57:27
问题 I've got two questions that I cannot find an answer for in the tutorial. I get a document and then an element from the doc like this: bsoncxx::document::element e = doc["id"]; if (!e || e.type() != bsoncxx::type::k_int32) return ERROR; int id = e.get_int32(); Is there a way to get a string value for the type, for debugging purposes? Like: std::cout << e.type() << std::endl; (which doesn't work) The second question is how to convert the utf8 type value into a std::string. This doesn't work: e

Why do I get Error resulting in state DEAD in MongoDB?

痴心易碎 提交于 2020-02-06 15:07:39
问题 I’m working with multidocument mongodb transactions, and I’m getting an unexpected error. In my c++ app, using mongocxx driver, the steps I’m performing are the following: create session start transaction create a bulk_write 1 for this session, where I have multiple updates (~1000) to colletion 1 create another bulk_write 2 for this session, where I have multiple inserts (~1000) to collection 2 execute bulk_write 1 execute bulk write 2 commit transaction This is the code snippet for the

Mongodb cxx + Unreal Engine 4 - Crash while iterating over Cursor

淺唱寂寞╮ 提交于 2020-01-23 12:06:09
问题 I got an error while or after iterating over a mongocxx::cursor after finding some documents in my database. I am using Windows 10, Unreal Engine 4.16.1 and mongodb cxx 3.1.1. The database connection is set up correctly, the find function finds my documents and returns a valid cursor. It ends up in this Exception: Exception thrown at 0x00007FFDED56B698 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation writing location 0x0000000000000010. with this output: 2598:0a50 @

Mongodb cxx + Unreal Engine 4 - Crash while iterating over Cursor

孤者浪人 提交于 2020-01-23 12:06:04
问题 I got an error while or after iterating over a mongocxx::cursor after finding some documents in my database. I am using Windows 10, Unreal Engine 4.16.1 and mongodb cxx 3.1.1. The database connection is set up correctly, the find function finds my documents and returns a valid cursor. It ends up in this Exception: Exception thrown at 0x00007FFDED56B698 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation writing location 0x0000000000000010. with this output: 2598:0a50 @