I have a mongodb collection called foo_collection
where the documents contains a field called createdby
that uses javascript Date.now()
to save the timestamp.
an example would be
{
"_id": {
"$oid": "618a669ea3bff474f6fe4767"
},
"widgetid": "ddbae9a2-4156-11ec-905a-02cf95edae88",
"publisher_id": "938ecebe-1089-11ec-8bd1-0a57868782b0",
"impression_id": "b6bfc0bc-1dc4-11ec-850e-0a57868782b0",
"logid": "ksaeqkqe65",
"createdby": {
"$numberLong": "1636460191573"
}
}
As you can see the field createdby
uses $numberLong
to save the data.
And, According to the doc The static Date.now() method returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
How to query the collection foo_collection
using pymongo
such that I get the datas between two date range ?