Add ability to pass queries as dictionaries to the filter method