wqj2101 opened a new issue #40: Destroying An Undefined Doc Removes the Whole 
Database
URL: https://github.com/apache/couchdb-nano/issues/40
 
 
   Recently discovered a bug when trying to delete a doc from a CouchDB 
database. The action of deleting a document with "undefined" inputs actually 
removes the whole database. The <dbName>.destroy() call should really be 
restricted to destroying documents and not the whole DB itself.  If an 
undefined is sent in, I think nano should ideally return an error?  
   
   This is a sample code to reproduce what happens:
   
   const nano = require( 'nano' )( CouchDB );
   const dbName = nano.db.use( 'dbName' );
   
   dbName.destroy( undefined, undefined, ( err ) => {
     **//DB is destroyed at this point**
   } );
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to