function (newDoc, oldDoc, userCtx) { // your validation code goes here }