I have MongoDB C++ Driver at https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/tutorial/ compiled and ready, tested OK with literal data.
But the challenge is how to store a Boost ptree into MongoDB as a document. I have a Boost ptree because I'm using Boost to parse JSON string.
The process is as following:
Input --> JSON String (OK) --> Boost ptree (OK) --> MongoDB insert (stuck!)
Got a solution finally!
These are the steps: