How to update existing object inside an array using mongoose
问题 I'm trying to make a currency system with my discord.js bot and mongoose. Here is an example MongoDB document format: { guild: "2095843098435435435", wallets: [ { id: "2323232335354", amount: 10, }, { id: "24344343234454", amount: "i want to update this", }, ], }; As far as I know, the Array.prototype.push() function is for making a new object inside an array. But how can I update an existing object inside an array? My code: const find = await Account.findOne({ guild: message.guild.id, }); if