-
Type:
Bug
-
Resolution: Gone away
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:C++
Windows
-
None
-
None
-
None
-
None
-
None
-
None
-
None
I'm trying to convert a JSON string to Bson Object.
From Stackoverflow answers, I found that I can use like this,
mongo::BSONObj object = mongo::fromjson("name: 'hi'");
But, VS code display that both mongo and BSON as undefined.
This is what I have included
#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/json.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/stdx.hpp>
#include <mongocxx/uri.hpp>
#include <mongocxx/instance.hpp>
using bsoncxx::builder::stream::close_array;
using bsoncxx::builder::stream::close_document;
using bsoncxx::builder::stream::document;
using bsoncxx::builder::stream::finalize;
using bsoncxx::builder::stream::open_array;
using bsoncxx::builder::stream::open_document;