Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. // make sure we return the updated person, with tags fully populated
  2. return Person.findOne({ _id: userID }).populate('tags').lean().exec((_err, got) => {
  3. if (!got) { // person does not exist
  4. return res.status(404).send({ error: 'person not found' })
  5. }
  6. req.crudify.result = got
  7. next()
  8. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement