Hello,
I am using release 3.1.1 of the mongocxx driver with the streaming interface. I would like to update a collection with the upsert option to insert a document if not found. Currently, the following command will update a document correctly, however, I don't know how to add the upsert option to the update_one function, or to set upsert=true as default for the socioCollection collection.
socioCollection.update_one(document{} <<
"RUT" << rutStr << finalize,
document{} << "$set" << open_document <<
"Nombres" << nomStr <<
"Apellidos" << apeStr <<
"Sector" << secStr <<
"categoria" << catStr <<
"telefono" << telStr <<
"correo" << corStr <<
close_document << finalize);
// .upsert(true);
// mongocxx::options::update_one::upsert(true)
// update_one& mongocxx::options::update_one::upsert(true)
// );