Would it make sense to store an array of JSON objects in a metafield with type string?

Hey Andy,

I’m going to double check on this for you to make sure I’m correct here (if I’m wrong, I’ll update this), but **json** is a valid type. The note you mentioned about the deprecated **json_string** is referring to a previous type that had existed. If you look at the column “API Name”, there previously was a type there with that json_string namespace.

You’re correct that the Javascript methods JSON.parse() and JSON.stringify() will convert a JSON object from/to a string and add those quotes for you. Check out the Mozilla docs for more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

Good luck!

Ben

2 Likes