def METHOD_NAME(domain, form_or_case=None):
    from .models import ExportInstance
    doc_types = [doc_type for doc_type in [
        'FormExportInstance' if form_or_case in ['form', None] else None,
        'CaseExportInstance' if form_or_case in ['case', None] else None,
    ] if doc_type is not None]
    results = ExportInstance.get_db().view(
        'export_instances_by_domain/view',
        keys=[[domain, doc_type, True] for doc_type in doc_types],
        include_docs=False,
        reduce=False,
    ).all()
    return [result['value'] for result in results]