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
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
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.