I have many documents as below in the CosmosDB container
{
"id": "62ea57a5e85b97356ea8e8b4",
"snapshotId": "62ea57a55238bbda2b06d446",
"statusTypeCode": "available",
"transactionId": "2507280",
"stockRecordID": "2520929",
"sku": 7806200,
"packSize": 12,
"quantityOfUnits": 107,
"unitOfMeasure": "each",
"svfCreatedDate": "2022-08-01",
"createdDate": "2022-08-01",
"lastModifiedDate": "2022-08-01",
"_rid": "YvdMAPTHOwsBAAAAAAAAAA==",
"_self": "dbs/YvdMAA==/colls/YvdMAPTHOws=/docs/YvdMAPTHOwsBAAAAAAAAAA==/",
"_etag": "\"00000000-0000-0000-a73e-e2629c6b01d8\"",
"_attachments": "attachments/",
"_ts": 1659534153
}
And I'm trying to get documents by Date like this :
var allDocs = mycontainer.Where(d =>
d.CreatedDate == DateTime.UtcNow.AddDays(-2).Date
).ToList();
Date comparison is not working here. I tried updating the Document with different Date Formats, Removing the Time Part. Am I missing anything? Please advice.