How to convert JSON Array to JSON

I am new to Make.com and trying my hand in automation.

My basic need is to convert JSON Array to JSON and post it to a Google Doc.

I have figured out way to extract JSON array and iterate through it but the problem is I am not able to create the JSON out of it.

Here is my input-
“openingHours”: [
{
“day”: “Monday”,
“hours”: “11:30 AM to 11:30 PM”
},
{
“day”: “Tuesday”,
“hours”: “11:30 AM to 11:30 PM”
},
{
“day”: “Wednesday”,
“hours”: “11:30 AM to 11:30 PM”
},
{
“day”: “Thursday”,
“hours”: “11:30 AM to 11:30 PM”
},
{
“day”: “Friday”,
“hours”: “11:30 AM to 11:30 PM”
},
{
“day”: “Saturday”,
“hours”: “11:30 AM to 11:30 PM”
},
{
“day”: “Sunday”,
“hours”: “11:30 AM to 11:30 PM”
}
],

And I need output like this-
{
“Sunday”: “11:30 AM to 11:30 PM”,
“Monday”: “11:30 AM to 11:30 PM”,
“Tuesday”: “11:30 AM to 11:30 PM”,
“Wednesday”: “11:30 AM to 11:30 PM”,
“Thursday”: “11:30 AM to 11:30 PM”,
“Friday”: “11:30 AM to 11:30 PM”,
“Saturday”: “11:30 AM to 11:30 PM”
}

The order of the JSON items don’t really matter.
Any help will be much appreciated.

This is my scenario:

Welcome to the Make community!

You have an array, and you want to convert it into a collection (object).

You can use the built-in function toCollection

e.g.:

{{ toCollection(1.openingHours; "day"; "hours") }}

For more information, see the function documentation in the Help Center and do the tutorials in the Make Academy.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Thank you @samliew for your reply. I have updated my question with my scenario screenshot.

I tried the solution but now I am getting below error:
Collection can’t be converted to text for parameter ‘text’.

Below is the Google Doc setting: