github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/delete.en.md (about)

     1  ### `delete()` {#fn-delete}
     2  
     3  Function prototype: `fn delete(src: map[string]any, key: str)`
     4  
     5  Function description: Delete the key in the JSON map
     6  
     7  ```python
     8  
     9  # input
    10  # {"a": "b", "b":[0, {"c": "d"}], "e": 1}
    11  
    12  # script
    13  j_map = load_json(_)
    14  
    15  delete(j_map["b"][-1], "c")
    16  
    17  delete(j_map, "a")
    18  
    19  add_key("j_map", j_map)
    20  
    21  # result:
    22  # {
    23  #   "j_map": "{\"b\":[0,{}],\"e\":1}",
    24  # }
    25  ```