Answer the question
In order to leave comments, you need to log in
How to make a post-comment system in node.js?
Good day.
As far as I understand, the scheme needs to be done like this? :
var postSchema = mongoose.Schema({
tags: [String],
text: String,
author: {
name: String,
url: String
},
addtime: String,
answers: [
answer={
author: {
name: String,
url: String
},
text: String,
comments: [
comment={
author: {
name: String,
url: String
},
text: String
}
],
}
]
});
Answer the question
In order to leave comments, you need to log in
Maybe so?:
var postSchema = mongoose.Schema({
tags: [String],
text: String,
author: {
name: String,
url: String
},
addtime: String,
answers: [
comments=[],
]
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question