I have an array in my database like this “items= [{name:‘john’,quantity:5},{name:‘steve’,quantity:10}]”,what I wanna do is to update the quantity to some other value based on the name input by the user. How can I do this?
After querying the data from database, you could use a for loop in you app and save the array back to database after updating.
for (let item of array){
if(item.name === 'john'){
item.quantity = 100;
}
}