title: MongoDB 3 Java check if collection exists
body: <p>I have the following problem:</p>
  
  <p>I'm using the Java driver for MongoDB 3.</p>
  
  <p>In version 2 it was possible to do DB.collectionExists(name) to check whether a collection exists in the selected database.</p>
  
  <p>In version 3 with the switch from DB to MongoDatabase this method no longer exists.</p>
  
  <p>How do I find out whether a collection exists inside a database? I tried to iterate over the collections with listCollectionNames() but this seems quite ineffective.</p>
  
  <p>Thanks for your help</p>