@transformer<EOL>def update_col(input, **params):
PARAM_TARGET = '<STR_LIT:target>'<EOL>PARAM_UPDATE = '<STR_LIT>'<EOL>SOURCE_TYPE = '<STR_LIT>'<EOL>SOURCE_COL = '<STR_LIT>'<EOL>SOURCE_FIELD = '<STR_LIT>'<EOL>DEST_FIELD = '<STR_LIT>'<EOL>SOURCE_TYPE_DOC = '<STR_LIT>'<EOL>SOURCE_TYPE_CONST = '<STR_LIT>'<EOL>CONST_VALUE = '<STR_LIT>'<EOL>update_list = params.get(PARAM_UPDATE)<EOL>res = input[params.get(PARAM_TARGET)] if PARAM_TARGET in params else input<EOL>for row in res:<EOL><INDENT>for update_desc in update_list:<EOL><INDENT>if update_desc[SOURCE_TYPE] == SOURCE_TYPE_DOC:<EOL><INDENT>row[update_desc[DEST_FIELD]] = input[update_desc[SOURCE_COL]][update_desc[SOURCE_FIELD]]<EOL><DEDENT>elif update_desc[SOURCE_TYPE] == SOURCE_TYPE_CONST:<EOL><INDENT>row[update_desc[DEST_FIELD]] = update_desc[CONST_VALUE]<EOL><DEDENT><DEDENT><DEDENT>return res<EOL>
Updates document with value from another document/collection/constant
:param input:
:param params:
:return: