driver-legacy/src/main/com/mongodb/DB.java
public boolean collectionExists(final String collectionName) {
        Set<String> collectionNames = getCollectionNames();
        for (final String name : collectionNames) {
            if (name.equalsIgnoreCase(collectionName)) {
                return true;
            }
        }
        return false;
    }
public boolean collectionExists(final String collectionName) {
        Set<String> collectionNames = getCollectionNames();
        for (final String name : collectionNames) {
            if (name.equalsIgnoreCase(collectionName)) {
                return true;
            }
        }
        return false;
    }
Checks to see if a collection with a given name exists on a server.

@param collectionName a name of the collection to test for existence
@return {@code false} if no collection by that name exists, {@code true} if a match to an existing collection was found
@throws MongoException if the operation failed