create Bucket
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)
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
Content copied to clipboard