@Francois: Да, вы правы, они не в ветке релиза. Они должны упомянуть, что в примерах странная вещь ...

ользую mongo-cxx-driver-r3.1.1 на основе mongo-c-driver-1.6.2. С использованиемпоследние примеры представлены на githubМне удалось найти, как подключить базу данных и как сохранить документы.

Я пытаюсь получить результаты, используя фильтр, следуя информации, представленной вПример mongocxx / query.cpp.

Существует много вызовов метода make_document, но у меня нет класса / метода / шаблона в пространстве имен bsoncxx с этим именем (та же проблема с make_array).

Вот что включает, директивы using и объявления использования:

#include <bsoncxx/builder/basic/document.hpp>
#include <bsoncxx/builder/basic/array.hpp>
#include <bsoncxx/builder/basic/kvp.hpp>
#include <bsoncxx/types.hpp>
#include <bsoncxx/json.hpp>
#include <bsoncxx/stdx/make_unique.hpp>
#include <bsoncxx/stdx/optional.hpp>
#include <bsoncxx/stdx/string_view.hpp>

#include <mongocxx/instance.hpp>
#include <mongocxx/pool.hpp>
#include <mongocxx/stdx.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/logger.hpp>
#include <mongocxx/uri.hpp>
#include <mongocxx/exception/exception.hpp>
#include <mongocxx/options/find.hpp>

using namespace mongocxx;
using namespace bsoncxx;

using bsoncxx::builder::basic::document;
using bsoncxx::builder::basic::kvp;
using bsoncxx::builder::basic::sub_document;
using bsoncxx::builder::basic::sub_array;
using bsoncxx::builder::basic::array;
using bsoncxx::types::value;
using mongocxx::result::insert_one;

Декларации об использовании "not found":

using bsoncxx::builder::basic::make_array;
using bsoncxx::builder::basic::make_document;

Я что-то упускаю из виду? Есть ли более свежие примеры?

Ответы на вопрос(1)

Ваш ответ на вопрос