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

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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source