我在https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/tutorial/有 MongoDB C++ 驱动程序已编译并准备就绪,并使用文字数据进行了测试。
但挑战在于如何将 Boost ptree 作为文档存储到 MongoDB 中。我有一个 Boost ptree,因为我使用 Boost 来解析 JSON 字符串。
过程如下:
输入 --> JSON 字符串 (OK) --> Boost ptree (OK) --> MongoDB 插入(卡住了!)