You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version
5.0.19
Exception: Method ToLowerInvariant() in String are not supported when convert to BsonExpression
Describe the bug
When using the ToLowerInvariant() method within the query expression, LiteDB throws an exception. This behavior occurs consistently whenever ToLowerInvariant() is utilized in the query expression.
Code to Reproduce
Create a query expression using ToLowerInvariant() method.
Execute the query with LiteDB.
Expected Behavior:
The query should execute without throwing any exceptions, even when ToLowerInvariant() method is used.
Actual Behavior:
LiteDB throws an exception when ToLowerInvariant() method is used in the query expression.
StackTrace:
at LiteDB.LinqExpressionVisitor.VisitMethodCall(MethodCallExpression node)
at LiteDB.LinqExpressionVisitor.VisitAsPredicate(Expression expr, Boolean ensurePredicate)
at LiteDB.LinqExpressionVisitor.VisitBinary(BinaryExpression node)
at System.Linq.Expressions.ExpressionVisitor.VisitLambda[T](Expression1 node) at LiteDB.LinqExpressionVisitor.VisitLambda[T](Expression1 node)
at LiteDB.LinqExpressionVisitor.Resolve(Boolean predicate)
at LiteDB.BsonMapper.GetExpression[T,K](Expression1 predicate) at LiteDB.LiteCollection1.FindOne(Expression`1 predicate)
The text was updated successfully, but these errors were encountered:
Version
5.0.19
Exception: Method ToLowerInvariant() in String are not supported when convert to BsonExpression
Describe the bug
When using the ToLowerInvariant() method within the query expression, LiteDB throws an exception. This behavior occurs consistently whenever ToLowerInvariant() is utilized in the query expression.
Code to Reproduce
Create a query expression using ToLowerInvariant() method.
Execute the query with LiteDB.
Expected Behavior:
The query should execute without throwing any exceptions, even when ToLowerInvariant() method is used.
Code Example:
collection.FindOne(x => x.Id == "1".ToLowerInvariant())
Actual Behavior:
LiteDB throws an exception when ToLowerInvariant() method is used in the query expression.
StackTrace:
at LiteDB.LinqExpressionVisitor.VisitMethodCall(MethodCallExpression node)
at LiteDB.LinqExpressionVisitor.VisitAsPredicate(Expression expr, Boolean ensurePredicate)
at LiteDB.LinqExpressionVisitor.VisitBinary(BinaryExpression node)
at System.Linq.Expressions.ExpressionVisitor.VisitLambda[T](Expression
1 node) at LiteDB.LinqExpressionVisitor.VisitLambda[T](Expression
1 node)at LiteDB.LinqExpressionVisitor.Resolve(Boolean predicate)
at LiteDB.BsonMapper.GetExpression[T,K](Expression
1 predicate) at LiteDB.LiteCollection
1.FindOne(Expression`1 predicate)The text was updated successfully, but these errors were encountered: