how to convert a mongoose object to string code example
Example: mongodb mongoose update convert string to object
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 }
);
});```