Where the magic is. Direct doc_id check and modification, see funcs below for direct case and xform updating