現在、JSON ファイルを mongoDB に挿入しようとしています。過去に mongo::BSONObj を使用することでこれが解決されたことをすでに見てきました...しかし、c ++ 11用の新しいmongoccxxドライバーがリリースされたため、これはオプションではないようです。これは、bsoncxx src ファイルで見つけたものです。
BSONCXX_API document::value BSONCXX_CALL from_json(stdx::string_view json);
/// Constructs a new document::value from the provided JSON text
///
/// @param 'json'
/// A string_view into a JSON document
///
/// @returns A document::value if conversion worked.
///
/// @throws bsoncxx::exception with error details if the conversion failed.
///
JSON ファイルを .xml ファイルに変換するにはどうすればよいstdx::string_view
ですか?
ありがとう!