Skip to content

Instantly share code, notes, and snippets.

@krogla
Last active November 25, 2017 21:28
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 krogla/56c2b4fc9045f438b4645a60c8253168 to your computer and use it in GitHub Desktop.
Save krogla/56c2b4fc9045f438b4645a60c8253168 to your computer and use it in GitHub Desktop.
//Remove contracts by ID
CustomContracts.find().fetch();
CustomContracts.remove("_CONTRACT_ID_");
//Remove tokens by ID
Tokens.find().fetch();
Tokens.remove("_TOKEN_ID_");
//Remove all contracts
CustomContracts.find().fetch().map(
function(m) { CustomContracts.remove(m._id);}
);
//remove only with condition
CustomContracts.find().fetch().map(
function(m) { if (m.name == '-') {CustomContracts.remove(m._id);}}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment