title: CouchDB validation prevents DELETE
body: <p>Wrote validation func for couch: </p>
  
  <pre><code>function(newDoc, oldDoc, userCtx) { 
  function isNullOrWhiteSpace(str){ return str === null || str.match(/^\s*$/) !== null; }
  function require(field, message) {
      message = message || "Document must have a " + field;
      if ((!newDoc[field]) || isNullOrWhiteSpace(newDoc[field])) throw({forbidden : message});
    };
   require("title");
   require("content"); 
  }
  </code></pre>
  
  <p>All good, except that I can't delete documents now — validation doesn't allow me to do it, saying that document must contain <code>title</code> and <code>id</code>. </p>
  
  <p>How to detect which operation is going now?</p>