将 MongoDB C++ 驱动程序升级到 mongocxx-3.1.2
Upgrading MongoDB C++ Driver to mongocxx-3.1.2
如何轻松地从 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
的类似物是bsoncxx::document::value
及其关联的视图类型bsoncxx::document::view
。 - 最接近
mongo::BSONObjBuilder
的类似物是bsoncxx::builder::basic::document
.
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- 使用mongocxx驱动程序时包含头文件问题
- Mongocxx无法使用SSL连接到mongoDB
- 获取 OID(类型::b_oid)作为 MongoDB C++驱动程序中的字符串
- MongoDB 使用数组中的 OR 条件构建查询
- 有没有办法使用 mongocxx 驱动程序从 GridFS 集合的文件下载任意范围?
- 使用 C++ 查询 MongoDB 的日期字符串
- MongoDB C++ 驱动程序 - 8 位和 16 位整数?
- 无法使用C++代码向MongoDB进行身份验证
- 将 MongoDB C++ 驱动程序升级到 mongocxx-3.1.2
- Mongodb C驱动程序在Windows上安装失败
- 修改Mongodb源代码以禁用文档的自动生成"_id"字段
- Mongodb C++编译问题
- Mongodb Cxx 驱动程序测试在发布版本中崩溃 [ 在调试中工作正常]
- CreateUser 使用 mongocxx 3.1.1 C++ 失败
- Mongocxx 连接错误
- 将mongocxx连接到mongodb服务器时出错:SSL支持不可用
- 如何使用mongocxx c ++驱动程序递归生成Mongodb文档?
- 如何通过mongocxx C++驱动程序在MongoDB中上传文件
- 将BSON数组添加到MongoDB 3.2文档并提取值(MongoCXX 3.2)(C++11)