I am trying to build comment model contains: Reply and CommentThread. CommentThread contains Reply, and Reply can recurse itself.
/models/comment.js :
va
https://searchcode.com/codesearch/view/6134527/
see the example above, you need to do something like
var replySchema = new Schema();
replyschema.add({
username: String,
timestamp: { type: Date, default: Date.now },
body: String,
replies: [replySchema]
});
run
npm install mongoose@3.8.5
for a quick fix