I had an object like
data: {
registrationNumber: 'MH1234',
type: 'xyz',
driver: {
user: {
firstName: 'xyz',
lastName: 'abc',
email: 'xyz',
phone: 1234,
city: 'random',
dateOfBirth: new Date(),
groups: [1]
}
},
owner: {
user: {
firstName: 'xyz',
lastName: 'abc',
email: 'xyz',
phone: '1234',
city: 'random',
groups: [1, 2]
},
kyc: [
{
method: 'xyz',
id: 'abcd'
},
{
method: 'xyz',
id: 'abcd'
}
]
}
}
how can i remove the element at path data.owner.kyc.0
?
I have tried using _.unset() but it is not ideal since the array still shows 2 elements after deletion