index.js
function (cb) {
          if (opts.dropCollection) {
            db.listCollections({name: collectionName})
              .toArray(function (err, items) {
                if (err) return cb(err)
                if (items.length) return coll.drop(cb)
                cb()
              })
          } else cb()
        }
function (cb) {
          if (opts.dropCollection) {
            db.listCollections({name: collectionName})
              .toArray(function (err, items) {
                if (err) return cb(err)
                if (items.length) return coll.drop(cb)
                cb()
              })
          } else cb()
        }
function ( cb ) { if ( opts . dropCollection ) { db . listCollections ( { name : collectionName } ) . toArray ( function ( err , items ) { if ( err ) return cb ( err ) if ( items . length ) return coll . drop ( cb ) cb ( ) } ) } else cb ( ) }
Drop collection if option is set and collection exists
Drop collection if option is set and collection exists