I would like to do a complex and/or query with Mongoose. Here is some pseudocode that shows what I'm trying to do:
Find persons where (
(date_begin == null || date_begin <= today)
&& (date_end == null || date_end >= tomorrow)
)
Here is my failing attempt at real Mongoose code:
query = Person
.find()
.where('date_begin').equals(null).or.where('date_begin').lte(today)
.where('date_end').equals(null).or.where('date_end').gte(tomorrow)
Any suggestions would be greatly appreciated! (FYI, today and tomorrow are being set fine, it's the Mongoose syntax I am asking about.)