-
Type: Bug
-
Resolution: Duplicate
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Summary
MongoDB.Driver.Linq.ExpressionNotSupportedException
HResult=0x80131515
Message=Expression not supported: (IIF((Convert($it.Gene, String) == null), null, Convert(IsMatch(Convert($it.Gene, String), "(^|\;)KIR2DL2(\;|$)", ECMAScript), Nullable`1)) == True).
Source=MongoDB.Driver
StackTrace:
於 MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators.MethodTranslators.StringExpressionToRegexFilterTranslator.TranslateComparisonExpression(TranslationContext context, Expression expression, Expression leftExpression, AstComparisonFilterOperator comparisonOperator, Expression rightExpression) 在 /_/src/MongoDB.Driver/Linq/Linq3Implementation/Translators/ExpressionToFilterTranslators/ExpressionTranslators/StringExpressionToRegexFilterTranslator.cs:行 305 中
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
"Microsoft.AspNetCore.OData" Version="8.0.12"
"MongoDB.Driver" Version="2.20.0"
MongoDB 5.0.6 Community
How to Reproduce
http://localhost:5163/odata/Analysis/Detail?$filter=matchesPattern(Gene,'(^|\;)KIR2DL2(\;|$)')
Additional Background
expression debug view
.If ((System.String)$$it.Gene == null)
.Else
{ (System.Nullable`1[System.Boolean]).Call System.Text.RegularExpressions.Regex.IsMatch( (System.String)$$it.Gene, "(^|\;)KIR2DL2(\;|$)", .Constant<System.Text.RegularExpressions.RegexOptions>(ECMAScript)) }== .Constant<System.Nullable`1[System.Boolean]>(True)
- duplicates
-
CSHARP-4698 Expression not supported: Regex.IsMatch
- Closed