MultiplatformMongoDatabase¶
interface MultiplatformMongoDatabase : MongoDatabase
A grouping of collections with the same theme.
The Multiplatform driver provides a coroutine-aware API which works on all supported Kotlin platforms.
What is a database?¶
Collections are grouped into databases to avoid name collisions. Databases are similar to Kotlin packages. If multiple applications are deployed in the same MongoDB instance in their own database, they can use the same collection names (e.g. users) without conflicts.
Each database has a name that must be unique within a MongoDB deployment.
Access¶
To obtain a database, see MultiplatformMongoClient.database.
To obtain a collection, see collection.
External resources¶
Properties¶
client¶
abstract val client: MultiplatformMongoClient
The MultiplatformMongoClient which created this database.
The MultiplatformMongoClient instance is responsible for the global configuration.
name¶
Functions¶
collection¶
inline fun <Document : Any> collection(name: CharSequence): MongoCollection<Document>
inline fun <Document : Any> collection(name: String): MultiplatformMongoCollection<Document>
Creates a MultiplatformMongoCollection object.
@LowLevelApi
abstract override fun <Document : Any> collection(name: String, type: KType): MultiplatformMongoCollection<Document>
Creates a MultiplatformMongoCollection object.