Not sure if this is the best way to pull all the case_ids from a domain, as it still loads all the ids into memory. However, I don't know how else to go about this.