def iter_document_ids(self, last_id=None):
        from corehq.apps.domain.dbaccessors import iterate_doc_ids_in_domain_by_type

        if not (self.domain and self.doc_type):
            raise ValueError('This function requires a domain and doc_type set!')
        start_key = None
        if last_id:
            last_doc = self.get_document(last_id)
            start_key = [self.domain, self.doc_type]
            if self.doc_type in _DATE_MAP.keys():
                start_key.append(last_doc[_DATE_MAP[self.doc_type]])

        return iterate_doc_ids_in_domain_by_type(
            self.domain,
            self.doc_type,
            chunk_size=ID_CHUNK_SIZE,
            database=self._couch_db,
            startkey=start_key,
            startkey_docid=last_id
        )
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/pillowtop/dao/couch.py/CouchDocumentStore.iter_document_ids/original