Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. Posts = new Mongo.Collection('posts');
  2.  
  3. Meteor.methods({
  4. 'addPost': function() {
  5. Posts.insert({title: 'Post ' + Random.id()});
  6. },
  7.  
  8. 'deletePost': function() {
  9. let post = Posts.findOne();
  10. if (post) {
  11. Posts.remove({_id: post._id});
  12. }
  13. }
  14. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement