I have an object that looks like this:
name:"Aachen"
mass:"21"
year:"1880-01-01T00:00:00.000"
I am trying to use $gte and $lte to find the entries that happened between certain YEARS.
I have tried this: db.collectionName.find({$expr: {$and: [{"year": {$gte:"1880"}}, {"year": {$lte: "1900"}} ]}})
but not getting any results
I think i need to parse the date to ISODate first and then destructure the year but not really sure how to perform the query.
Any guidance?
Thanks a lot