Summary
I can do this like on linq2 but error on linq3
public Task<long> UpdateEntityAsync(long id, Expression<Func<T, object>> exp, object value, Dictionary<string, object> update, MonTrans? monTrans = null, UpdateOptions? options = null)
|
{
|
var filter = Builders<T>.Filter.And(GetPkMatch(id), Builders<T>.Filter.Eq(exp, value));
|
var res = await collection.UpdateOneAsync(filter, new BsonDocument("$set", new BsonDocument(update), options));
|
return res.ModifiedCount;
|
}
|
I just need the object type can convert to well-known framework types and i can use by expression
MongoDB Driver Version: 2.19.0
MongoDB Version: 6.0 replica
|