In my database, I have a column that stores an array of elements, g.e, {"B", "A", "C"}. And I am trying to firstly sort this array alphabetically and then create a JSON from each element in the sorted array and then return it like the following:
{TEXTS : [{"TEXT":"A","sortOrder":1}, {"TEXT":"B","sortOrder":2}, {"TEXT":"C","sortOrder":3}]}
How can I achieve this?
{texts = ...}isn't valid JSON. If that is the intended output, then please also show us the input this is based on.