C++ 如何使用日期数据类型编写mongocxx(v3)查询?
我有一个集合,只需要根据字段updateDate(数据类型为Date)提取最新的数据。 我使用C++驱动程序(MangoCxx(V3))。p>C++ 如何使用日期数据类型编写mongocxx(v3)查询?,c++,mongodb,mongo-cxx-driver,C++,Mongodb,Mongo Cxx Driver,我有一个集合,只需要根据字段updateDate(数据类型为Date)提取最新的数据。 我使用C++驱动程序(MangoCxx(V3))。p> mongocxx::光标= collection.find(document{}您可以执行以下操作: 将(日期参数)替换为bsoncxx::types::b_date{}可能重复的 mongocxx::cursor cursor = collection.find(document{} << "updateDate" <<
mongocxx::光标=
collection.find(document{}您可以执行以下操作:
将(日期参数)替换为bsoncxx::types::b_date{}
可能重复的
mongocxx::cursor cursor =
collection.find(document{} << "updateDate" <<
open_document << "$gt" <<
(date parameter) << close_document <<
finalize);
for(auto doc : cursor) {
std::cout << bsoncxx::to_json(doc) << "\n";
}