var PostSchema = new Schema({(...)opinions: [ { type: Schema.ObjectId, ref: 'Opinion' } ]});while Opinions have 0-n Comments about each Opinion:var OpinionSchema = new Schema({(...)comments: [ { type: Schema.ObjectId, ref: 'Comment' } ]});When I view each post I want to populate such that I include all opinions and all comments on opinions with each post, and for various business reasons I want to keep posts, opinions and comments in separate (not embedded) models.What works:
What I can't figure out:
- Post.user info is included through ObjectId (works)
- detail for each of Post.opinions is included through ObjectIds (works)
- detail for post.opinions[n].user is shown for each opinion.user (doesn't yet work)
- detail for post.opinion[n].comments -- including the comment.user -- is shown (dosn't yet work)
so in short my issue is that I need to show detail from sub-subdocuments on Post through .populate :).
Advice/pointers welcome.
Thanks - Michael