Blame view

server/methods/remove/example.js 477 Bytes
36b159afd   Ryan Glover   Add server/method...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  /*
  * Methods: Remove - Example
  * Example of a method used for removing a document from the database.
  */
  
  Meteor.methods({
    exampleRemoveMethod: function(argument){
      // Check the argument. Assuming a String type here.
      check(argument, String);
  
      // Perform the remove.
      try {
        var exampleId = Example.remove(argument);
        return exampleId;
      } catch(exception) {
        // If an error occurs, return it to the client.
        return exception;
      }
    }
  });