I am working with the following object:
{ Id: '11ea9563-1a4c-c21b-904f-00ff98e8d5ab',
Email: 'Email',
Password:
{ type: 'Buffer',
data:
[ Buffer value] },
roles: [ { Name: 'Developer', userroles: [Object] } ],
Events:
[ { Id: '11ea9556-c025-39ae-904f-00ff98e8d5ab'} ] }
My goal is to extract the Id
, roles.Name
, and Events.Id
using lodash:
_.pick(obj, ['Id', 'roles.Name', 'Events.Id']),
However, I am only able to retrieve the Id with the above method.
Can someone guide me on how to achieve this with lodash?