MongoDB Transaction using mongo driver
type here bool create_and_insert_doc (mongoc_client_session_t *session, void *ctx, bson_t **reply, /* out param for our server reply */ bson_error_t *error) { /* * mongoc_collection_insert_one requires an uninitialized, stack-allocated * bson_t to receive the update result */ bson_t local_reply; bson_t *doc = NULL; ctx_t *data = NULL; bool retval; for (int i = 0; i < […]