onaio / onadata

Collect, Analyze and Share
https://ona.io
Other
183 stars 133 forks source link

OR filter not working with date time fields #2698

Closed kelvin-muchiri closed 2 months ago

kelvin-muchiri commented 2 months ago

Environmental Information

Problem description

The $or filter does not work for datetime meta data. Filtering by _submission_time, _date_modified, and _last_edited does not work.

Expected behavior

Filtering data by or should work for meta data fields

Steps to reproduce the behavior

Try filtering by or clause on endpoint api/v1/data/<form_id>?query={"$or": [{"_submission_time":{"$gte": "2020-01-01", "$lte": "2020-08-31"}}, {"_last_edited":{"$gte": "2020-01-01", "$lte": "2020-08-31"}}]}