Does jsonb type in postgres guarantee order preservation of json objects when storing/retrieving?

Viewed 36

I know that jsonb type doesn't guarantee the order of keys within a json object, but does is guarantee the order of json objects if you have an array of json objects stored in the jsonb type? For example:

[
  {
    "id": "FirstItem",
    "value": 1
  },
  {
    "id": "SecondItem",
    "value": 2
  }
]

Will the json object with id "FirstItem" always be the first object in the array when retrieving the jsonb value from the database?

0 Answers
Related