alexsosnovskiy

meteor - disable validation

Dec 14th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Meteor } from 'meteor/meteor';
  2. import { Mongo } from 'meteor/mongo';
  3. import SimpleSchema from 'simpl-schema';
  4.  
  5. const TestColl = new Mongo.Collection(null);
  6.  
  7. TestColl.schema = new SimpleSchema({
  8.   owner: {
  9.     type: String,
  10.   },
  11. });
  12.  
  13. TestColl.attachSchema(TestColl.schema);
  14.  
  15. Meteor.startup(function() {
  16.   TestColl.insert({ testField: 2 }, { validate: false, filter: false });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment