I am inserting images to the mongodb through c++ API as below :
bsoncxx::document::value document = bsoncxx::builder::basic::make_document
(kvp("userId", "xZcuQet3QMmS7Q2yc"),
kvp("source",encoded_png),
kvp("createdAt",bsoncxx::types::b_date(std::chrono::system_clock::now()))
);
bsoncxx::stdx::optional<mongocxx::result::insert_one> result =
coll.insert_one(document.view());
Also I am pulling realtime from MeteorJs . I encountered there is a few seconds (5 - 7 sec) delay.
Is it possible that c++ code not flushing the insert ?
How I can do realtime insert with flushing immediately available ?
Is that possible?