3
bsoncxx::builder::stream::document search_builder;
mongocxx::options::find img_find; // This speeds up the queries
search_builder_images.clear();
search_builder_images << "_id" << "abc" << "data" << open_document <<"$exists" << true << close_document ;
for (bsoncxx::document::view doc : cursor_cal) {
std::cout << bsoncxx::to_json(doc) << std::endl;
}
auto cursor_cal = dbMongo [collectionName] .find(search_builder.view());
ここでランダムに50-50%のチャンスがありますが、時々私が期待している出力が得られますが、時々セグメンテーションフォールトエラーが発生します。
私は間違っていますか? (私はこのsearch_builderを作成してmongodbデータベースを検索し、データが存在する文書を取得しようとしています)