createBucket

suspend fun createBucket(name: String, common: CommonOptions = CommonOptions.Default, ramQuota: StorageSize = 100.mebibytes, bucketType: BucketType? = null, storageBackend: StorageBackend? = null, evictionPolicy: EvictionPolicyType? = null, flushEnabled: Boolean? = null, replicas: Int? = null, maximumExpiry: Expiry? = null, compressionMode: CompressionMode? = null, minimumDurability: Durability? = null, conflictResolutionType: ConflictResolutionType? = null, replicateViewIndexes: Boolean? = null, @SinceCouchbase(value = "7.2") historyRetentionCollectionDefault: Boolean? = null, @SinceCouchbase(value = "7.2") historyRetentionSize: StorageSize? = null, @SinceCouchbase(value = "7.2") historyRetentionDuration: Duration? = null, @SinceCouchbase(value = "8.0") numVBuckets: Int? = null)

Throws

BucketExistsException

if bucket already exists

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
}