create Bucket
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)
Content copied to clipboard
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. Bucket Exists Exception
if bucket already exists