added date comparison condition to support querying documents within a specified date