Forum Discussion
Ah, okay… In that case, it’s okay if the property name is in quotes, either way is acceptable.
As for writing out just the document and not an array of docs, try selecting the “Format each document” option in the JSONFormatter.
Hi @tstack
I have a similar requirement here. But my input to JSON formatter snap is the output from union snap and it has many segments and not one. In that case with multiple segments how can I remove square bracket and an extra curly bracket.
Thanks,
Abinaya
nickhumble - my apologies - I missed your original response to my question.
If there are two input documents that you want to combine to a single document, I would recommend using the Gate snap in this case. Then follow with a Mapper snap with the following expression:
The jsonPath is a powerful function that allows you to rip through a JSON structure looking for specific sub-elements easily and return the results as an array. This specific syntax tells jsonPath to return all elements buried under the top three arrays.
Note that the Gate snap has some considerations when processing larger volumes of data, but for this case, it works very nicely. Also, the jsonPath documentation has some external links for additional details of how you can work with it along with some good examples.
Hope this helps!
- nickhumble2 years agoNew Contributor II
Thanks Koryknick - this has worked for me. My dataset is larger than what i shared but not enormous and i think should be ok.
nickhumble - the input you have listed - is that 2 input documents, or one field value?
- nickhumble2 years agoNew Contributor II
It's 2 input documents, thanks.
- nickhumble2 years agoNew Contributor II
koryknick any ideas? Thanks!