Weired Problem with Date field query returning zero results only using Atlas Data API

Are you sure you are looking at the same document?

I am not.

The one in Atlas has an appropriate date that ends with .0000+00:00 while the other one ends with Z.

It looks like the document 64e73f03ed4d31d42c8d7b58 really has a field named publicationDate which is an object that has a field named $date with a string value.

That would explain that you get:

Try the queries

filter = {"publicationDate.$date": {"$type": "string"}}
print(collection.count_documents(filter))

and

filter = {"publicationDate.$date" : "2023-07-28T00:00:00Z" }
print(collection.count_documents(filter))