I'm trying to get a set of results with timestamp within a given date range from a CosmosDb using the Table API.
This is how I'm constructing my query:
var from = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.GreaterThanOrEqual,
new DateTimeOffset(2018, 2, 15, 15, 2, 45, TimeSpan.Zero));
var to = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.LessThan,
new DateTimeOffset(2018, 2, 15, 15, 3, 45, TimeSpan.Zero));
return new TableQuery<Audit>()
.Where(
TableQuery.CombineFilters(from, TableOperators.And, to));
However, when I run this query I get the following exception of type InvalidFilterException
:
ODataException: Unrecognized 'Edm.String' literal 'datetime'2018-02-15T15:02:45.0000000Z'' at '14' in '(Timestamp ge datetime'2018-02-15T15:02:45.0000000Z') and (Timestamp ge datetime'2018-02-15T15:03:45.0000000Z')'.
Can anyone help me understand what this means? Am I doing something wrong?
Can anyone help me understand what this means? Am I doing something wrong?
I also can reproduce this with Microsoft.Azure.CosmosDB.Table version 1.0.0 on my side.
If I update the version of Microsoft.Azure.CosmosDB.Table version to 1.1.0 then no exception, the filter result count always equals 0.
It seems that filtering with Timestamp is not supported now. You also could give your feedback to Azure team.