Update mongodb

This commit is contained in:
sunkaixuan
2025-07-11 17:35:57 +08:00
parent ce87e40d41
commit 14751c5003
13 changed files with 33 additions and 16 deletions

View File

@@ -12,6 +12,7 @@ namespace MongoDb.Ado.data
{
public class QueryFindHandlerAsync : IQueryHandlerAsync
{
public HandlerContext Context { get; set; }
public CancellationToken token { get; set; }
public async Task<DbDataReader> HandlerAsync(IMongoCollection<BsonDocument> collection, BsonValue doc)
{
@@ -34,7 +35,7 @@ namespace MongoDb.Ado.data
throw new ArgumentException("Invalid JSON format for MongoDB find operation.");
}
var findFluent = collection.Find(filter);
var findFluent =Context?.IsAnyServerSession==true? collection.Find(Context.ServerSession,filter) : collection.Find(filter);
if (projection != null)
findFluent = findFluent.Project<BsonDocument>(projection);