I have a news collection with documents, which may (or may not) have limited time of activity.
I have 3 fields which indicate if news is valid. active, valid_from, valid_to. Normaly I would do this kind of query:
where active = true and (valid_from = null or valid_from < Time.now) and (valid_to= null or valid_to > Time.now). OK. Time.now is ruby only, but I hope you understand.
Can this be done with mongoid and how.
Thank you