add doc_as_upsert to update()

Added `doc_as_upsert`, a new arg to `update`.