I have a field called @editors in my index . It has multiple values like , i would like only show the last editor name in last_editors field .
I want to write a query where i can only fetch the the last editor name in each _id(document)
The number of editors different in each document
- "@editors": "sunny", "mandy", "krish"
- "@editors": "sony"
3."@editors": "maya", "firta"
4."@editors": "riya", "viru", "mandy", "giri"
Please suggest me a query which can check if it is a single value it returns the value as it is if it is mutiple it will return the last value name in that field