I am using Meteor 1.5 with MongoDB 3.2
I am using below Simple Schema to insert into Clients Collection.
import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
SimpleSchema.extendOptions(['autoform']);
export const Clients = new Mongo.Collection('Clients');
ClientsSchema = new SimpleSchema({
"gstNo": {
type: String,
label: "GST No.",
regEx: /^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$/,
optional: true,
},
"mobile": {
type: String,
label: "Mobile 1",
regEx: /^[789]\d{9}$/,
}
});
Clients.attachSchema( ClientsSchema );
With simple QuickForm using Aldeed's AutoForm 6.0 it works great.
Problem Scenario:
I perform Bulk Insert as I have Clients with count 3000. I Parse the "valid" excel sheet and then using loop I tried inserting data but the operation fails when regex did not match for Mobile No.
Question:
How to suppress SimpleSchema field validation when I perform "bulk insert" for a collection which already has a SimpleSchema attached to it? Also I want customer to put any Mobile no during Bulk Insert as User might not know the regex.