Skip to content

Instantly share code, notes, and snippets.

@thjc
Created October 3, 2019 07:52
Show Gist options
  • Select an option

  • Save thjc/27e6d7458dd13045cf40206eb92ab3ae to your computer and use it in GitHub Desktop.

Select an option

Save thjc/27e6d7458dd13045cf40206eb92ab3ae to your computer and use it in GitHub Desktop.
// 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()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment