I need to filter a list and transform the payload. Using Elasticsearch 5.6
Example(Groovy) def list = [1,2,3,4,5] def result = list.findAll { it > 2 }
The result would be [3,4,5]
This is showing syntax exception in my watcher. Need a painless syntax to achieve above functionality
try
list.stream().filter(x -> x > 2).collect(Collectors.toList())
Thanks spinscale Just realized painless corresponds to java 8 syntax.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 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.