Should use "Validate Schema on Insert/Update Method" again or not, if We attach it on Collection already?


#1

I use Simple Schema attach to my Collection.
Should I set Schema Validate on Insert/Update Method again???

// Collection 
const Classifications = new Mongo.Collection('classifications')
Classifications.schema = new SimpleSchema({
  name: {
    type: String,
    unique: true,
  },
  status: {
    type: String,
  },
  memo: {
    type: String,
    optional: true,
  },
})

Classifications.attachSchema(Classifications.schema)
export default Classifications
-------------
// Method
export const insertClassification = new ValidatedMethod({
  name: 'app.insertClassification',
  mixins: [CallPromiseMixin],
  validate: new SimpleSchema({...............}).validator(), // or use 'null'
  run(doc) {
    if (Meteor.isServer) {
        return Classifications.insert(doc)
    }
  },
})

Or use validate: null on method, because we attach it on Collection already.
Please advise :sunny: