add get_doc_ids utility and tests
Merge pull request #4033 from dimagi/get-doc-ids

add get_doc_ids utility and tests