Skip to content

Instantly share code, notes, and snippets.

@donedgardo
Created February 8, 2017 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donedgardo/0beca8815d898bbbd69fd2d43522c30d to your computer and use it in GitHub Desktop.
Save donedgardo/0beca8815d898bbbd69fd2d43522c30d to your computer and use it in GitHub Desktop.
ES6 Article
this.model('FoodTrucks')
.findOneAndUpdate(
{
_id: foodTruckId,
owner: currentUser._id
}, // The food truck to update
{ $set: updatedProperties}, // The update
{ new: true } // Return the modified version
).exec((err, data) => {
if (err) reject(err);
else resolve(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment