// This file is autogenerated, DO NOT EDIT
// docs/update.asciidoc:224

[source, python]
----
resp = client.update(
    index="test",
    id="1",
    script={
        "source": "if (ctx._source.tags.contains(params.tag)) { ctx.op = 'delete' } else { ctx.op = 'noop' }",
        "lang": "painless",
        "params": {
            "tag": "green"
        }
    },
)
print(resp)
----
