Nested mongoose Schema giving trouble when trying to query in controller <p>I'm working on a small project and I have a solution to this problem, but it involves creating a new Schema with a reference to the new Schema in the old Schema. I would like to avoid this if at all possible because it will mean spending a couple hours rewriting some code and messing with tests. </p> <p>The project is a forum site, and there are three main Schemas that comprise it (in addition to cursory Schemas for the forums, notifications, settings and the schemas for the user and the users activities). The Board Schema (contains a list of all forum sections if that wasn't apparent) Is a Schema that makes a reference to the Threads Schema so it can get the threads for each Board. My problem is in the Thread Schema.</p> <pre><code>var ThreadSchema = new mongoose.Schema({ ... other unrelated Schema stuff... comments: [{ created: { type: Date, default: Date.now }, creator: { type: mongoose.Schema.ObjectId, required: true, ref: 'User' }, content: { type: String, required: true, get: escapeProperty }, likes: [{ type: mongoose.Schema.ObjectId, required: false, ref: 'User' }], liked: { type: Boolean, default: false }, saved: [{ type: mongoose.Schema.ObjectId, required: false, ref: 'User' }] }] }); </code></pre> <p>blah blah blah.</p> <p>I'm trying to pull for the users profile only the comments that that user has posted. The threads were easy, but comment data is not coming through. The request to the server goes through as successful, but I don't get any data back. This is what I am trying.</p> <pre><code>obj.profileComments = function (req, res) { var userId = req.params.userId; var criteria = {'comments.creator': userId}; Thread.find(criteria) .populate('comments') .populate('comments.creator') .skip(parseInt(req.query.page) * System.config.settings.perPage) .limit(System.config.settings.perPage + 1) .exec(function (err, threads) { if (err) { return json.bad(err, res); } json.good({ records: threads }, res); }); }; </code></pre> <p>This is a controller, and the json.bad and json.good are helpers that I have created and exported they basically are res.send.</p> <pre><code>var good = function (obj, res) { res.send({ success: 1, res: obj }); }; </code></pre> <p>and the bad is very similar, it just handles errors in an obj.res.errors and puts them into messages.</p> <p>So now that that is all out of the way, I'm a little lost on what to do? Is this something I should try to handle with a method in my Schema? It seems like I might have a little bit more luck that way. Thank you for any help.</p>