Skip to content

Instantly share code, notes, and snippets.

// make sure we return the updated person, with tags fully populated
return Person.findOne({ _id: userID }).populate('tags').lean().exec((_err, got) => {
if (!got) { // person does not exist
return res.status(404).send({ error: 'person not found' })
}
req.crudify.result = got
next()
})