Don't ignore doc_as_upsert_value and simplify. Closes #3265

This simplifies the code and should close #3265