Is there any standard approach to check object contains array args in a method call using audit-argument-checks?


#1

currently i am following this approach
https://github.com/HedCET/torrentzAlert/blob/master/server/publications.js#L36


#2

#3

Hi linto,

Have you try this:

Meteor.methods({

‘yourMethod’: function(obj) {

  // obj = {array: ..., otherField1: ..., otherField2: ...}
  check(obj, {
     array: [String],
     otherField1: Date,
     otherField2: String
  });

}
});

Have a look at: http://docs.meteor.com/#/full/check

Hope it helps, cheers