1var SimSchema = new Schema({
2 msisdn : { type : String , unique : true, required : true, dropDups: true },
3 imsi : { type : String , unique : true, required : true, dropDups: true },
4 status : { type : Boolean, default: true},
5 signal : { type : Number },
6 probe_name : { type: String , required : true }
7});
8
1emailVerificationTokenSchema.post('save', function(error, doc, next) {
2 if (error.name === 'MongoError' && error.code === 11000) {
3 next(new Error('email must be unique'));
4 } else {
5 next(error);
6 }
7});
8