📌  相关文章
📜  mongoose 中的 mongo 对象引用 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:02.033000             🧑  作者: Mango

代码示例1
User = new Schema({
    places:[{type: Schema.Types.ObjectId, ref:'Place'}],
    shouts:[{type: Schema.Types.ObjectId, ref:'Shout'}]
});
Place = new Schema({
    name:String,
    description:String,
});
Shout = new Schema({
    content:String,
});