added --ids as option for query