Handle ODM document upserts