I created a free M0 mongodb cluster in the Atlas Cloud.
I added about 400.000 documents with book data using python MongoClient.
The documents contain a field “publicationDate” of the type “Date” which i defined as follows in python:
Now the problem:
I created a small HTML page to display all books. That uses a little php script and the Atlas DATA API to query the data. The API queries work, but as soon as i add the filter for the year it returns zero results.
I also get no results when I run the query in the Atlas admin backend, although the field “publicationDate” is clearly marked with the type “Date” there!
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.