Created
February 8, 2017 22:52
-
-
Save donedgardo/0beca8815d898bbbd69fd2d43522c30d to your computer and use it in GitHub Desktop.
ES6 Article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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