Update: unset a key

Hello,

Is there a way to unset a key of a document using the update API?

I'm looking for the equivalent of $unset in mongo.

Thanks,
JB

Hi,

you can use a scripted update and remove a field there.

Here's the example from the docs I am referring to:

curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{
    "script" : "ctx._source.remove(\"name_of_field\")"
}'

Daniel

Thanks for your help,
it's really strange that this is not provided as a "classic" feature