After I released maintenance release of JSON UDFs last week it
is time to think about which features I should implement in
upcoming major version.
Many users asked me about the possibility to explicitly specify
if they want to append last element to a JSON array. This feature
can be made for two functions: json_append and
json_set.
I have four ideas of how to implement this. All have pros and
contras.
-
- Create new function called json_append_last which will
work exactly like json_append, but it will add the element
to the end of array. I.e., for JSON document {"colors":
["red", "green", "blue"]} json_append_last(doc, 'colors',
'orange') returns {"colors": ["red", "green", "blue",
"orange"]}
- …