How to upgrade from mongoDB C++ driver from Legacy to mongocxx-3.1.2 easly? What are the classes in mongocxx-3.1.2 for following?
mongo::BSONElement;
mongo::BSONObj;
mongo::BSONObjBuilder;
Thanks In Advance..
There is no "upgrade" - the libraries offer entirely different APIs. You will need to re-write the parts of your application that interact with BSON or MongoDB in order to use it (you will also need a modern C++ toolchain).
To understand the analogues for the types you are asking about, I recommend reading https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/working-with-bson/
Complete documentation for the current stable version of the library (3.1.2) is available here: https://mongodb.github.io/mongo-cxx-driver/api/current/
To elaborate a bit on the mappings of the types you requested:
mongo::BSONElement
is bsoncxx::document::element
mongo::BSONObj
is bsoncxx::document::value
and its associated view type bsoncxx::document::view
.mongo::BSONObjBuilder
is bsoncxx::builder::basic::document
.