Adjusted to be less intrusive

Change upsert_doc to doc_as_upsert as well