MongoDB Mongoose Update Convert String en objet


const media = await Media.find({});
            media.forEach(async (item) => {
            const update = await Media.findOneAndUpdate(
                    { _id: item._id },
                    { user: mongoose.Types.ObjectId(item.user) },
                    { upsert: true }
                );
            });```
amit.bhagat