Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
couchbase-index-manager
Advanced tools
Provides a command-line interface to manage Couchbase indexes, synchronizing them to index definitions provided in files. It is intended to be used as part of a CI/CD pipeline, or to assist with local development.
It also provides an API which may be used by importing a node module.
The sync command executes an index synchronization
couchbase-index-manager sync <bucketName> <path>
bucketName
should be the name of the bucket to sync, and path
is the path to the index definitions. path
may be either a single YAML or JSON file, or a directory containing multiple files.
couchbase-index-manager -c couchbase://localhost -u Administrator -p password sync beer-sample ./directory/
couchbase-index-manager -c couchbase://localhost -u Administrator -p password sync beer-sample ./directory/file.yaml
couchbase-index-manager -c couchbase://localhost -u Administrator -p password sync beer-sample ./directory/file.json
Definition files may be written in either JSON or YAML. The define the name of the index, the columns to be index, and may also contain other options.
When YAML is used, multiple definitions may be provided in a single file, separated by a line of dashes.
name: BeersByAbv
index_key:
- abv
condition: (`type` = 'beer')
num_replica: 0
---
name: BeersByIbu
index_key:
- ibu
condition: (`type` = 'beer')
num_replica: 0
---
name: OldIndex
lifecycle:
drop: true
Field | Required | Description |
---|---|---|
name | Y | Name of the index |
index_key | Y | Array of index keys. May be attributes of documents deterministic functions |
condition | N | Condition for the WHERE clause of the index |
num_replicas | N | Defaults to 0, number of index replicas to create |
lifecycle.drop | N | If true, drops the index if it exists |
It is important that couchbase-index-manager be able to recognize when indexes are updated. Couchbase Server performs certain normalizations on both index_key and condition, meaning that the values in Couchbase may be slightly different than the values submitted when the index is created.
Therefore, it is important that the definition files be created with normalization in mind. Make sure the definitions include the already normalized version of the keys and condition, otherwise couchbase-index-manager may drop and recreate the index on each run.
If an index is removed from the definition files, it is not dropped. This prevents different CI/CD processes from interfering with each other as they manage different indexes. To drop an index, leave the definition in place but set lifecycle.drop
to true
.
A Docker image for running couchbase-index-manager is available at https://hub.docker.com/r/btburnett3/couchbase-index-manager.
docker run --rm -it -v ./:/definitions btburnett3/couchbase-index-manager -c couchbase://cluster -u Administrator -p password sync beer-sample /definitions
FAQs
Manage Couchbase indexes during the CI/CD process
The npm package couchbase-index-manager receives a total of 7 weekly downloads. As such, couchbase-index-manager popularity was classified as not popular.
We found that couchbase-index-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.