sql >> Base de Datos >  >> NoSQL >> MongoDB

MongoDB C++, Cómo agregar el valor ISODate al insertar

¡Gracias Styvane, descubrí cómo!

value Value = document{}
<<"Key" <<"Value"
<<"Date" <<bsoncxx::types::b_date(std::chrono::system_clock::now())
<<finalize;

cxxClient["db"]["collection"].insert_one(Value.view());