database

abstract fun database(name: String): MongoDatabase(source)

Creates a MongoDatabase object.

This method is purely a client-side operation, it does nothing in the MongoDB server. In MongoDB, databases and collections are created implicitly on the first insert.

To learn more about the restrictions on the database name, see MongoDatabase.name.

For an example, see MongoClient.