Skip to content

Instantly share code, notes, and snippets.

@shinecita
Created October 26, 2012 20:27
Show Gist options
  • Save shinecita/3961284 to your computer and use it in GitHub Desktop.
Save shinecita/3961284 to your computer and use it in GitHub Desktop.
Model.addOrganization = function(model, organizationId, done) {
console.log("model:", model, "organizationId" , organizationId )
Model.save({_id:model._id, $addToSet: {organizations: toObjectId(organizationId)}}, function(err) {
console.log(err);
done(null, model);
})
}
@shinecita
Copy link
Author

App Online @ port 8000
model: { _id: 508af1a9bdaeb50000000001,
email: '[email protected]',
token: '2f934c2de5c8f5292f4ad0e9e3ecf08f6e5b0b61',
status: 'invited' } organizationId 5087f7e11f5926a035000003
null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment