def preserve_sesam_special_fields(target, original):
    """
    Preserves special and reserved fields.
    ref https://docs.sesam.io/entitymodel.html#reserved-fields

    """

    sys_attribs = ["_deleted","_hash","_id","_previous","_ts","_updated","_filtered", "$ids", "$children", "$replaced"]

    for attr in sys_attribs:

        if attr in original:
            target[attr] = original[attr]
          
    return target