📅  最后修改于: 2022-03-11 14:56:10.543000             🧑  作者: Mango
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 }
);
});```