I have JSON
[
{"id": "1"},
{"id": "5"},
{"id": "9"},
{"id": "0"},
{"id": "3"}
]
I want to insert an object to produce:
[
{"id": "1"},
{"id": "5"},
{"id": "2"},
{"id": "9"},
{"id": "0"},
{"id": "3"}
]
How do I do this jq? Either by index or relative to other objects.
EDIT: This is not a duplicate of Add new element to existing JSON array with jq , which is about appending/prepending elements to arrays. As stated, I want to insert an element.