I have a json response in the form of:
[{
"id": 425055,
"title": "Foo"
}, {
"id": 425038,
"title": "Bar"
}, {
"id": 425015,
"title": "Narf"
}]
I use oboe.js to create a highland stream:
const cruiseNidStream = _((push, next) => {
oboe({
url: 'http://fake.com/bar/overview,
method: 'GET',
headers: {
'X-AUTH': 'some token',
},
}).node('.*', (overview) => {
// I expect here to get an object having and id, title property
push(null, overview.id);
}).done((overview) => {
push(null, _.nil);
}).fail((reason) => {
console.error(reason);
push(null, _.nil);
});
});
My problem is that I don't know what pattern to use node so that it matches each element of that array. As currently the items I am getting with the current setup are all the objects and the properties again:
425055
Foo
{ id: 227709, title: 'Foo' }
If the response would have had a property like:
{
'overview': [],
}
I could have used .overview.*
.