3

I want to remove an element in array, if the field is not array, do nothing.

if (ctx._source?.field != null) {
  ctx._source.field.remove(ctx._source.field.indexOf('value'))
} 

In order to do so, it has to determine whether the field is an array, or exception is expected. How?

In addition, is there detailed instruction of Painless? There is only get-started in elasticsearch website.

Allen_Tsang
  • 555
  • 1
  • 6
  • 14

0 Answers0