Need help to store nested json format into database and get the correct output

If you’re using NodeJS, you can create this JSON structure inside a Set Value step, and store in the DB by using var1.toJSON().
Then, when you retrieve it, just use query1.col1.parseJSON() in a Set Value and return that.

Ref: How best to unwrap a stringified JSON