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)

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


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)