showing results for - "id of other schema type mongoose"
María Fernanda
24 Jan 2021
1var postSchema = new Schema({
2    name: String,
3    postedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
4    dateCreated: Date,
5    comments: [{body:"string", by: mongoose.Schema.Types.ObjectId}],
6});
7