When I run the following query on AZure portal, it runs fine but when ran programmatically from a .NET App, it gives an error:
Raw query on Azure CosmosDB portal: SELECT * FROM c where c.OrderDateTime > '2018-11-29T18:33:17.5957307Z' Works fine
string queryString = $"SELECT * FROM c Where c.OrderDateTime >= '{DateTime.UtcNow.AddDays(-1).ToString("s")}'"; Gives the following error:
Message:
{\"Errors\":[\"An invalid query has been specified with filters against path(s) that are not range-indexed. Consider adding allow scan header in the request.\"]}
I understand Dates in range query needs different handling than strings, but was wondering how it can work on the portal? Am I missing something else in my code?
OrderDataTimecolumn,please have a try? - Jay Gong