On Sun, May 17, 2015 at 9:41 PM, Josh Berkus <josh@agliodbs.com> wrote:
Is there a particular reason why "+" makes more sense as "shallow concatination" and "||" makes more sense as "deep concatination"? Like, something in JS or other client languages which would make that preference make more sense to users?
As someone who uses JSON day-to-day in Javascript and Python, I personally don't think || or + matters much. Python uses json.loads() for JSON concat and you have use a 3rd-party library in Javascript if you want that functionality such as JQuery.extends(). I agree with Peter that we need deep concatenation, but I don't think there is any standard for the operator. I think the word "shallow" should be added to the docs though.
What is far more important than shallow or deep concatenation for the document database use case is being able to delete or replace/update a specific, nested path in the JSON object. It looks like that is possible with the minus operator and jsonb_replace(). This is great, however it took me awhile to figure out the path syntax. I think adding a paragraph to the docs explaining the path syntax would help.