Using streamObject and streamArray together? #155
faransajid
started this conversation in
General
Replies: 2 comments
-
It looks like you would need two streams:
Alternatively, you can always consume raw parser tokens to make your processing pipeline as flexible and as efficient as possible. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you @uhop . Could you please assist me a little more? I am not sure how to combine these two streams together in a single file read. Or Do I need to read the file twice? Also, could you provide me an example for raw parser tokens for my case? Many thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Sorry if I'm missing something here but I am unable to get the desired results using the parser.
Here's my json data:

I need to get the following complete objects:
And then I want chats>list array in streams (because that node is the one that can grow very big)
I was trying to do something as follows:
const pipeline = chain([ createReadStream(jsonFile), parser(), // to get complete objects excluding chats node pick({filter: 'personal_information'}), pick({filter: 'profile_pictures'}), pick({filter: 'contacts'}), ignore({filter: 'chats'}), streamObject(), // to stream the list array from chats node pick({filter: 'chats'}), pick({filter: 'list'}), streamArray(), ]);
Any help is appreciated, thanks.
Beta Was this translation helpful? Give feedback.
All reactions