如果结果为model
,我应该怎么知道?
FilterDefinition<T> filter = Builders<T>.Filter.Eq("_id", modelId);
UpdateDefinition<T> update = ... ;
var opts = new FindOneAndUpdateOptions<T>()
{
IsUpsert = true,
ReturnDocument = ReturnDocument.After
};
var model = this.Collection.FindOneAndUpdate(filter, update, opts);