I'm trying to perform a case insensitive search using the C# Cosmos SDK, v3.11.0. From reading the CosmosDB blog post the SQL API now supports this - but I can't get it to work using the SDK. The release notes for 3.10.0 would suggest this is supported but I can't find any documentation on how to use it.
I've tried the following code but it does not perform a case-insensitive search:
query.Where(d => d.Name.Contains(name, StringComparison.InvariantCultureIgnoreCase));
Using the following code results in an exception being thrown:
query.Where(d => d.Name.StartsWith(name, StringComparison.InvariantCultureIgnoreCase))
Microsoft.Azure.Cosmos.Linq.DocumentQueryException: Method 'StartsWith' is not supported., Windows/10.0.18363 cosmos-netstandard-sdk/3.11.2
at Microsoft.Azure.Cosmos.Linq.BuiltinFunctionVisitor.Visit(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.StringBuiltinFunctions.Visit(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.BuiltinFunctionVisitor.VisitBuiltinFunctionCall(MethodCallExpression methodCallExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitNonSubqueryScalarExpression(Expression inputExpression, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitNonSubqueryScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitScalarExpression(Expression expression, ReadOnlyCollection`1 parameters, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitScalarExpression(LambdaExpression lambda, TranslationContext context)
at Microsoft.Azure.Cosmos.Linq.ExpressionToSql.VisitWhere(ReadOnlyCollection`1 arguments, TranslationContext context)