Added support for q parameter to delete_by_query