标签: mongodb schema mongoose ref objectid
我有一个名为card的架构要更新 来自{_id: ObjectId, id: String, ....} 到{_id: String(same as id), id: String, ....}
{_id: ObjectId, id: String, ....}
{_id: String(same as id), id: String, ....}
并更新名为users的模式 {name: String, email: string, cards: {type: ObjectId, ref: 'card'}}
{name: String, email: string, cards: {type: ObjectId, ref: 'card'}}
我该怎么做?