2

Example: [{3},{1},{2}]. Does it sort it? [{1},{2}, {3}]

I was confused because of this answer? https://stackoverflow.com/a/49833552/15502607

  1. JSON maintains the order in which elements are inserted, while JSONB maintains the "sorted" order.
2
  • 1
    [{3},{1},{2}] is an invalid JSON value to begin with. Commented Mar 3, 2022 at 13:46
  • example........ Commented Mar 3, 2022 at 13:52

1 Answer 1

6

No, the point in the answer was about the order of the keys in a JSONB object. JSONB arrays maintain the order of their elements in the insertion order.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.