createBucket

suspend fun createBucket(name: String, common: CommonOptions = CommonOptions.Default, ramQuota: StorageSize = 100.mebibytes, bucketType: BucketType = BucketType.COUCHBASE, storageBackend: StorageBackend? = null, evictionPolicy: EvictionPolicyType? = null, flushEnabled: Boolean = false, replicas: Int = 1, maximumExpiry: Expiry = Expiry.none(), compressionMode: CompressionMode = CompressionMode.PASSIVE, minimumDurability: Durability = Durability.none(), conflictResolutionType: ConflictResolutionType = ConflictResolutionType.SEQUENCE_NUMBER)

Samples

import com.couchbase.client.kotlin.Cluster
import com.couchbase.client.kotlin.util.StorageSize.Companion.mebibytes
fun main() { 
   //sampleStart 
   // Create a new bucket
cluster.buckets.createBucket(
    name = "my-bucket",
    ramQuota = 256.mebibytes,
) 
   //sampleEnd
}

Throws

com.couchbase.client.core.error.BucketExistsException

if bucket already exists