Answer the question
In order to leave comments, you need to log in
Mongodb ref populate?
How to work with links in Mongo? I have a user:
let alex = new User({
name: "Alex",
age:21
});
alex.save();
let PostSchema = new mongoose.Schema({
postedBy: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
comments: [{
text: String,
}]
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question