O'Reilly logo
  • Patrick S thinks this is interesting:

        a(href="/project/#{projectID}/task/edit/#{task._id}", title="#{task.taskDesc}") #{task.taskName}

Accessing a specific subdocument

As we saw earlier, each subdocument has a unique _id field. When you pass this to the subdocument method .id() that Mongoose provides, you will get the subdocument returned to you.

Project.findById( req.body.projectID,...


Cover of Mongoose for Application Development


accessing subdocument