📜  其他模式类型猫鼬的 id - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:54.195000             🧑  作者: Mango

代码示例1
var postSchema = new Schema({
    name: String,
    postedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
    dateCreated: Date,
    comments: [{body:"string", by: mongoose.Schema.Types.ObjectId}],
});