由于IMongoCollection<T>.InsertOneAsync(...)
没有返回任何值(awaitable
Task
除外),而its documentation没有说明异常,我怎么能确定添加了新记录没有错误发生?
IMongoCollection<RecordType> batch = recordsBatchFactory.Create();
RecordType newRecord = makeNewRecord();
await batch.InsertOneAsync(newRecord);
// is newRecord guaranteed to be in the DB at this point?