title: Check if collection exists before dropping in Mongoose
body: <p>When the collection doesn't exist when <code>drop()</code> is called, an error is thrown:</p>
  
  <blockquote>
    <p>ns not found</p>
  </blockquote>
  
  <p>Currently I'm using something like</p>
  
  <pre><code>try {
      await MongooseModel.collection.drop();
  } catch (err) {
      if (err.message !== 'ns not found') {
          throw err;
      }
  }
  </code></pre>
  
  <p>which doesn't smell too good. It's not really clear why an error is thrown in the first place, I would expect that <code>drop()</code> will return <code>false</code> if it didn't exist, like it's done in Mongo console.</p>
  
  <p>How can this be done when there is only a reference to Mongoose model, <code>MongooseModel</code>?</p>
  
  <p>I don't have a reference to connection object in the place where I'm doing this, like is suggested in <a href="https://stackoverflow.com/a/13445233/3731501">this answer</a>.</p>