def delete_docs(target_db, doc_ids):
    if not doc_ids:
        return
    doc_id_rev_pairs = _bulk_get_revs(target_db, doc_ids)
    with IterDB(target_db, new_edits=False) as iter_db:
        for doc_id, doc_rev in doc_id_rev_pairs:
            iter_db.delete({'_id': doc_id, '_rev': doc_rev})
    if iter_db.errors_by_type:
        logging.error('errors bulk saving in delete_docs: {!r}'
                      .format(iter_db.errors_by_type))
delete docs from database by doc _id and _rev
dataset/ETHPy150Open dimagi/commcare-hq/corehq/doctypemigrations/continuous_migrate.py/delete_docs