Skip to content

Instantly share code, notes, and snippets.

@mrm8488
Created December 23, 2015 11:11
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 mrm8488/0b6298264b25a9ac7ec4 to your computer and use it in GitHub Desktop.
Save mrm8488/0b6298264b25a9ac7ec4 to your computer and use it in GitHub Desktop.
var User = require('route/to/models/User.js');
// Find a user by his ID
User.findById(<id>, function(error, user) {
if (error) throw error;
user.banned = true;
// Save the changes
user.save(function(error) {
if (error) throw error;
console.log(user banned!);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment