@cbjsdev/deploy
v1.23.0
Published
Utils to manage Couchbase deployment
Downloads
215
Readme
[!IMPORTANT] This package is part of the Cbjs project.
Getting started
npm install @cbjsdev/deploy
Create a cluster config file that will hold your keyspaces, indexes and users definitions :
import { CouchbaseClusterConfig } from '@cbjsdev/deploy';
const config: CouchbaseClusterConfig = {
keyspaces: {
myBucket: {
ramQuotaMB: 1024,
scopes: {
scopeOne: {
collections: {
collectionOne: {
maxExpiry: 120,
history: true,
indexes: {
group: {
keys: ['groupId'],
where: 'groupId != "groupSystem"'
}
}
},
}
}
}
}
},
users: [
{
username: 'lee_koss',
password: 'password',
roles: [{ name: 'fts_admin', bucket: 'myBucket'}]
}
]
}
Applying changes
You can apply changes by executing those two lines of codes.
const changes = getCouchbaseClusterChanges(currentConfig, nextConfig);
await applyCouchbaseClusterChanges(changes);