templates/validation-function/template.js
function simpleTypeFilter(newDoc, oldDoc, candidateDocType) {
    if (oldDoc) {
      if (newDoc._deleted) {
        return oldDoc.type === candidateDocType;
      } else {
        return newDoc.type === oldDoc.type && oldDoc.type === candidateDocType;
      }
    } else {
      return newDoc.type === candidateDocType;
    }
  }
function simpleTypeFilter(newDoc, oldDoc, candidateDocType) {
    if (oldDoc) {
      if (newDoc._deleted) {
        return oldDoc.type === candidateDocType;
      } else {
        return newDoc.type === oldDoc.type && oldDoc.type === candidateDocType;
      }
    } else {
      return newDoc.type === candidateDocType;
    }
  }
function simpleTypeFilter ( newDoc , oldDoc , candidateDocType ) { if ( oldDoc ) { if ( newDoc . _deleted ) { return oldDoc . type === candidateDocType ; } else { return newDoc . type === oldDoc . type && oldDoc . type === candidateDocType ; } } else { return newDoc . type === candidateDocType ; } }
A type filter that matches on the document's type property
A type filter that matches on the document s type property