如何轻松地从 mongoDB C++ 驱动程序从 Legacy 升级到 mongocxx-3.1.2?mongocxx-3.1.2 中有哪些课程可供关注?
mongo::BSONElement;
mongo::BSONObj;
mongo::BSONObjBuilder;
提前致谢..
如何轻松地从 mongoDB C++ 驱动程序从 Legacy 升级到 mongocxx-3.1.2?mongocxx-3.1.2 中有哪些课程可供关注?
mongo::BSONElement;
mongo::BSONObj;
mongo::BSONObjBuilder;
提前致谢..
没有“升级”——这些库提供完全不同的 API。您需要重新编写与 BSON 或 MongoDB 交互的应用程序部分才能使用它(您还需要一个现代 C++ 工具链)。
要了解您所询问的类型的类似物,我建议阅读https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/working-with-bson/
库的当前稳定版本 (3.1.2) 的完整文档可在此处获得:https ://mongodb.github.io/mongo-cxx-driver/api/current/
要详细说明您请求的类型的映射:
mongo::BSONElement
是bsoncxx::document::element
mongo::BSONObj
isbsoncxx::document::value
及其关联的视图类型bsoncxx::document::view
。mongo::BSONObjBuilder
是bsoncxx::builder::basic::document
。