cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JSON containers

peter
New Contributor III

I have a data set which is the following format:
[
{โ€œversion_idโ€:โ€œ1660โ€},
{โ€œversion_idโ€:โ€œ1639โ€}
]

and I would like to put the data into the following format;

[
{โ€œCurrentValuesโ€:
{โ€œversion_idโ€:โ€œ1660โ€},
{โ€œversion_idโ€:โ€œ1639โ€}
}
]

Any help would be much appreciated.

2 REPLIES 2

igormicev
Contributor

Hi @peter,

Your second json structure is not a valid one.

/Igor

ptaylor
Employee
Employee

Hi @peter,

When you post JSON or code snippets, please put them inside a โ€œPreformatted textโ€ section, otherwise, the double-quotes will get mangled by the forum into left-right quotes, which wonโ€™t be usable as JSON.

Your example is a bit ambiguous. Is the first โ€œdata setโ€ a single input document containing an array, or is it two separate input documents, each containing a separate object? Iโ€™ll assume the first for now.

Also, Igor is correct, the second JSON block isnโ€™t valid JSON syntax. Iโ€™ll assume you intend for the value of โ€œCurrent Valuesโ€ to be the array of objects from the input document.

If those assumptions are correct, try this:

image