dominictarr / JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
Other
1.92k stars 165 forks source link

If the root element in my json is an array, how do get items ? #87

Open samurex opened 8 years ago

samurex commented 8 years ago

Hello! example I have json: [ {"first": "1"}, {"second": "1"} ] I want to parse all the items in the array, I tried '$[*]' as a JSONPath but didnt work, any idea:) ?

dominictarr commented 8 years ago

just use "*" as the path.

r4j4h commented 8 years ago

And you can use $* if you have a mixture and want the keys as well. ;)

rjmunro commented 7 years ago

Using * as the path works, but $* isn't working for me. I need to know the integer key of the items.