CipherStash
CipherStash Documentation

Describing the Details of a Collection with Stash CLI

You can display the indexes defined on a collection in your workspace using the stash describe-collection command. In order to successfully describe a collection, you must be logged in.

Synopsis

stash describe-collection <name> \
    [--json]

Arguments

The only argument is <name>, the name of the collection to describe. The collection must already exist with the given name within the workspace.

Options

  • --json (optional) if specified, then output will be in JSON format, rather than a human-readable table.

Examples

Describe the movies collection in the workspace:

$ stash describe-collection movies
┌─────────────┬────────────┬─────────────┬─────────────────┐
│ Index Name  │ Index Type │ Field(s)    │ Query Operators │
├─────────────┼────────────┼─────────────┼─────────────────┤
│ exactTitle  │ exact      │ title       │ =               │
├─────────────┼────────────┼─────────────┼─────────────────┤
│ title       │ match      │ title       │ =~              │
├─────────────┼────────────┼─────────────┼─────────────────┤
│ year        │ range      │ year        │ <, <=, =, >= >  │
├─────────────┼────────────┼─────────────┼─────────────────┤
│ runningTime │ range      │ runningTime │ <, <=, =, >= >  │
└─────────────┴────────────┴─────────────┴─────────────────┘

Describe the movies collections in the workspace, providing the output as a JSON object:

$ stash describe-collection --json
{
  "exactTitle": {
    "indexType": "exact",
    "fields": "title",
    "operators": "="
  },
  "title": {
    "indexType": "match",
    "fields": "title",
    "operators": "=~"
  },
  "year": {
    "indexType": "range",
    "fields": "year",
    "operators": "<, <=, =, >= >"
  },
  "runningTime": {
    "indexType": "range",
    "fields": "runningTime",
    "operators": "<, <=, =, >= >"
  }
}

Exit Status

The exit status will be 0 if the collection was successfully retrieved and displayed. An exit status of 1 indicates a failure to retrieve the collection, most likely because the collection does not exist, credentials were invalid, or the server was unavailable.

Whenever a non-zero exit status is returned, a helpful error message is printed to standard error.