I have a mongoDB ( collection with documents possibly containing two dates, dateA and dateB. These dates aren't guaranteed to be set, and can be null.
I want to write a find query that expresses:
if dateA is not null:
if dateA is less than someArbitraryDate
or
if dateB is not null:
if dateB is less than someArbitraryDate
Looking at this answer, I know I probably need to use $expr and $cond.
I'm just not sure how to write the find.