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
 Identifiers:
┌───────────────────┬──────────────────────────────────────────────────────────────────┐
│ ID                │ df1a2232-b5a0-4d9d-9a82-532277f493d7                             │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Name              │ movies                                                           │
├───────────────────┼──────────────────────────────────────────────────────────────────┤
│ Ref (hex encoded) │ 6a5b5eb7a37ce3848a13d11f3b2223b2054129fbaf4a97adac256b700747c08f │
└───────────────────┴──────────────────────────────────────────────────────────────────┘

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

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

$ stash describe-collection --json
{
  "id": "df1a2232-b5a0-4d9d-9a82-532277f493d7",
  "name": "movies",
  "ref": "6a5b5eb7a37ce3848a13d11f3b2223b2054129fbaf4a97adac256b700747c08f",
  "mappings": {
    "exactTitle": {
      "indexType": "exact",
      "fields": "title",
      "operators": "="
    },
    "runningTime": {
      "indexType": "range",
      "fields": "runningTime",
      "operators": "<, <=, =, >= >"
    },
    "year": {
      "indexType": "range",
      "fields": "year",
      "operators": "<, <=, =, >= >"
    },
    "title": {
      "indexType": "match",
      "fields": "title",
      "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.