You can use _.omit()
for emitting the key from a JSON array if you have fewer objects:
_.forEach(data, (d) => {
_.omit(d, ['keyToEmit1', 'keyToEmit2'])
});
If you have more objects, you can use the reverse of it which is _.pick()
:
_.forEach(data, (d) => {
_.pick(d, ['keyToPick1', 'keyToPick2'])
});