Closed
Description
Hi! Let's assume I have the following data:
obj = {
_id: 'someId',
items: [
{ value: 'a', count: 5 },
{ value: 'b', count: 1 },
]
}
Please, I want to know how can I use obj.increment() to increment the count field of the first element in items?
I have tried obj.increment('items.0.count') but it doesn't work. I got the following error: Cannot read property '0' of undefined