mongoDB c++11 Driver get ID of inserted Document mongoDB c++11 Driver get ID of inserted Document mongodb mongodb

mongoDB c++11 Driver get ID of inserted Document


    auto retVal = db.insert_one(hey.view());  // Part where document is uploaded to database    bsoncxx::oid oid = retVal->inserted_id().get_oid().value;    std::string JobID = oid.to_string();

I asked the mongoDB team. got this working response =).