Created
December 23, 2015 11:15
-
-
Save mrm8488/ce3f9f39176bb3c6b65f to your computer and use it in GitHub Desktop.
This file contains 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
var User = require('route/to/models/User.js'); | |
User.findUserById(<id>).then(function(user) { | |
user.banned = true; | |
return User.saveUser(user); | |
}).then(function() { | |
return User.removeUserByName('manuel'); | |
}).then(function() { | |
return User.findAllUsers(); | |
}).then(function(users) { | |
console.log(users); | |
}).catch(function(error) { | |
throw error; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment