optimze mongodb query default limit=10

This commit is contained in:
nick.yi 2025-10-14 16:30:16 +08:00
parent f6e9f4689b
commit bce3e1cf11

View file

@ -154,7 +154,13 @@ public class SqlSelect : IFunctionCallback
// Apply limit
var limitMatch = Regex.Match(chainedOps, @"\.limit\s*\((\d+)\)");
if (limitMatch.Success && int.TryParse(limitMatch.Groups[1].Value, out var limit))
{
findFluent = findFluent.Limit(limit);
}
else
{
findFluent = findFluent.Limit(10);
}
return findFluent;
}