Skip to content

Instantly share code, notes, and snippets.

@lloiacono
Created October 7, 2018 18:38
Show Gist options
  • Save lloiacono/6be26a834cb12dbd547d42cb229350c8 to your computer and use it in GitHub Desktop.
Save lloiacono/6be26a834cb12dbd547d42cb229350c8 to your computer and use it in GitHub Desktop.
ES painless script example: remove element from array
curl -X POST \
http://some:port/indexname/_doc/docId/_update \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"script": {
"lang": "painless",
"inline": "ctx._source.first_name.remove(ctx._source.first_name.length - 1)"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment