Closed lganzzzo closed 4 years ago
Now BSON DateTime data type is supported.
#include "oatpp-mongo/bson/Types.hpp" ... auto duration = std::chrono::system_clock::now().time_since_epoch(); auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count(); collection.insert_one(createMongoDocument( oatpp::Fields<oatpp::Any>({ {"time", oatpp::mongo::bson::DateTime(millis)} }) ));
Inserted document:
_id: ObjectId("5f9b6ecb21a7da049662e7d2") time: 2020-10-30T01:39:23.940+00:00
Links:
Now BSON DateTime data type is supported.
Inserted document:
Links: