Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

id of other schema type mongoose

var postSchema = new Schema({
    name: String,
    postedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
    dateCreated: Date,
    comments: [{body:"string", by: mongoose.Schema.Types.ObjectId}],
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #id #schema #type #mongoose
ADD COMMENT
Topic
Name
3+3 =