I create custom validation with difference operation
...............
custom: function () {
if (Meteor.isServer && this.isSet) {
// Insert
if (!this.operator) {
console.log('insert:');
return locationIsExists(Collection, selector);
} else {// Update
console.log('update: ');
// would like to get _id and currentDoc
return locationIsExists(Collection, selector);
}
}
}
In the update operation
, I would like to get the _id
and currentDoc
.
Please help me.