# Doc Store

Manage document store in sfp server

* [`sfp server doc-store add`](#sfp-server-doc-store-add)
* [`sfp server doc-store collection add`](#sfp-server-doc-store-collection-add)
* [`sfp server doc-store collection delete`](#sfp-server-doc-store-collection-delete)
* [`sfp server doc-store collection get`](#sfp-server-doc-store-collection-get)
* [`sfp server doc-store collection list`](#sfp-server-doc-store-collection-list)
* [`sfp server doc-store collection update`](#sfp-server-doc-store-collection-update)
* [`sfp server doc-store delete`](#sfp-server-doc-store-delete)
* [`sfp server doc-store get`](#sfp-server-doc-store-get)
* [`sfp server doc-store update`](#sfp-server-doc-store-update)

## `sfp server doc-store add`

Add a document to the doc store

```
USAGE
  $ sfp server doc-store add -k <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-v <value> | -f <value>]

FLAGS
  -e, --email=<value>              [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                   --application-token is provided.
  -f, --file=<value>               Path to JSON file containing the value
  -k, --key=<value>                (required) Key for the document
  -t, --application-token=<value>  [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                   over --email.
  -v, --value=<value>              Value for the document (must be valid JSON)
      --repository=<value>         The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>     [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                   `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add a document to the doc store

EXAMPLES
  $ sfp server doc-store add --key myKey --value '{"data": "value"}' --email user@example.com

  $ sfp server doc-store add --key myKey --value '{"data": "value"}' --application-token myToken

  $ sfp server doc-store add --key myKey --file ./data.json --email user@example.com
```

*See code:* [*src/commands/server/doc-store/add.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store collection add`

Add a document to a collection in the doc store

```
USAGE
  $ sfp server doc-store collection add -c <value> (-k <value> | -d <value>) [--json] [--repository <value>] [-e <value>] [-t
    <value>] [--sfp-server-url <value>] [-v <value> | -f <value> | ]

FLAGS
  -c, --collection=<value>         (required) Name of the collection
  -d, --folder=<value>             Path to folder to process recursively
  -e, --email=<value>              [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                   --application-token is provided.
  -f, --file=<value>               Path to JSON file containing the value
  -k, --key=<value>                (required) Key for the document
  -t, --application-token=<value>  [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                   over --email.
  -v, --value=<value>              Value for the document (must be valid JSON)
      --repository=<value>         The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>     [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                   `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add a document to a collection in the doc store

EXAMPLES
  $ sfp server doc-store collection add --collection myCollection --key myKey --value '{"data": "value"}' --email user@example.com

  $ sfp server doc-store collection add --collection myCollection --key myKey --value '{"data": "value"}' --application-token myToken

  $ sfp server doc-store collection add --collection myCollection --key myKey --file ./data.json --email user@example.com

  $ sfp server doc-store collection add --collection myCollection --folder ./data --email user@example.com
```

*See code:* [*src/commands/server/doc-store/collection/add.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store collection delete`

Delete a document from a collection in the doc store

```
USAGE
  $ sfp server doc-store collection delete -c <value> [--json] [-k <value> | -m <value>] [-n <value>]

FLAGS
  -c, --collection=<value>  (required) Name of the collection
  -k, --key=<value>         Key of the document to delete
  -m, --keys=<value>        Comma-separated list of document keys to delete
  -n, --version=<value>     Version of the document to delete

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Delete a document from a collection in the doc store

EXAMPLES
  $ sfp server doc-store collection delete --collection myCollection --key myKey --version 1 --email user@example.com

  $ sfp server doc-store collection delete --collection myCollection --key myKey --version 1 --application-token myToken

  $ sfp server doc-store collection delete --collection myCollection --keys key1,key2,key3 --version 1 --email user@example.com
```

*See code:* [*src/commands/server/doc-store/collection/delete.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store collection get`

Get documents from a collection in the doc store

```
USAGE
  $ sfp server doc-store collection get -c <value> [--json] [-k <value> | -o <value> | -f <value>...] [-s <value>...] [--limit
    <value>] [--offset <value>] [-e <value> | -t <value>] [--sfp-server-url <value>]

FLAGS
  -c, --collection=<value>         (required) Name of the collection
  -e, --email=<value>              Email used for authentication
  -f, --filter=<value>...          Filter documents using expressions like 'field=value', 'field>value', 'field~pattern'
  -k, --key=<value>                Key of the document to retrieve
  -o, --output-folder=<value>      Output folder path to recreate the collection structure
  -s, --sort=<value>...            Sort results by field:direction (e.g., 'createdAt:desc')
  -t, --application-token=<value>  Application token for authentication
      --limit=<value>              [default: 100] Maximum number of results to return (default: 100)
      --offset=<value>             Number of results to skip for pagination (default: 0)
      --sfp-server-url=<value>     [default: http://localhost:3029, env: SFP_SERVER_URL] URL of the SFP server

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Get documents from a collection in the doc store

EXAMPLES
  $ sfp server doc-store collection get --collection myCollection --key myKey --email user@example.com

  $ sfp server doc-store collection get --collection myCollection --key myKey --application-token myToken

  $ sfp server doc-store collection get --collection myCollection --output-folder ./output --email user@example.com

  $ sfp server doc-store collection get --collection myCollection --output-folder ./output --application-token myToken



  # Filter by status

  $ sfp server doc-store collection get -c builds --filter "status=completed" --email user@example.com



  # Multiple filters with sorting

  $ sfp server doc-store collection get -c packages \

    --filter "status=active" \

    --filter "version>2.0" \

    --sort "createdAt:desc" \

    --limit 10 \

    --email user@example.com



  # Pattern matching

  $ sfp server doc-store collection get -c releases --filter "name~core" --email user@example.com



  # In operator for multiple values

  $ sfp server doc-store collection get -c deployments --filter "env in(dev,staging,prod)" --email user@example.com
```

*See code:* [*src/commands/server/doc-store/collection/get.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store collection list`

List all doc store collections on the server

```
USAGE
  $ sfp server doc-store collection list [--json] [-e <value> | -t <value>] [--sfp-server-url <value>]

FLAGS
  -e, --email=<value>              Email of the user
  -t, --application-token=<value>  Application token for authentication
      --sfp-server-url=<value>     [default: http://localhost:3029, env: SFP_SERVER_URL] URL of the sfp server

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List all doc store collections on the server

EXAMPLES
  $ sfp server doc-store collection list --email user@example.com

  $ sfp server doc-store collection list --application-token myToken

  $ sfp server doc-store collection list --email user@example.com --json
```

*See code:* [*src/commands/server/doc-store/collection/list.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store collection update`

Update a document in a collection in the doc store

```
USAGE
  $ sfp server doc-store collection update -c <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-k <value> | -d <value>] [-v <value> | -f <value> | ] [-n <value>] [-u]

FLAGS
  -c, --collection=<value>         (required) Name of the collection
  -d, --folder=<value>             Path to folder to process recursively
  -e, --email=<value>              [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                   --application-token is provided.
  -f, --file=<value>               Path to JSON file containing the value
  -k, --key=<value>                Key of the document to update
  -n, --current-version=<value>    Version of the document to update
  -t, --application-token=<value>  [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                   over --email.
  -u, --upsert                     Create document if it does not exist, otherwise update it
  -v, --value=<value>              New value for the document (must be valid JSON)
      --repository=<value>         The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>     [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                   `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update a document in a collection in the doc store

EXAMPLES
  $ sfp server doc-store collection update --collection myCollection --key myKey --value '{"data": "value"}' --current-version 1 --email user@example.com

  $ sfp server doc-store collection update --collection myCollection --key myKey --value '{"data": "value"}' --current-version 1 --application-token myToken

  $ sfp server doc-store collection update --collection myCollection --key myKey --file ./data.json --current-version 1 --email user@example.com

  $ sfp server doc-store collection update --collection myCollection --folder ./data --current-version 1 --email user@example.com
```

*See code:* [*src/commands/server/doc-store/collection/update.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store delete`

Delete a document from the doc store

```
USAGE
  $ sfp server doc-store delete -k <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-n <value>]

FLAGS
  -e, --email=<value>              [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                   --application-token is provided.
  -k, --key=<value>                (required) Key of the document to delete
  -n, --version=<value>            Version of the document to delete
  -t, --application-token=<value>  [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                   over --email.
      --repository=<value>         The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>     [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                   `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Delete a document from the doc store

EXAMPLES
  $ sfp server doc-store delete --key myKey --email user@example.com

  $ sfp server doc-store delete --key myKey --application-token myToken
```

*See code:* [*src/commands/server/doc-store/delete.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store get`

Get a document from the doc store

```
USAGE
  $ sfp server doc-store get -k <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>]

FLAGS
  -e, --email=<value>              [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                   --application-token is provided.
  -k, --key=<value>                (required) Key of the document to retrieve
  -t, --application-token=<value>  [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                   over --email.
      --repository=<value>         The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>     [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                   `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Get a document from the doc store

EXAMPLES
  $ sfp server doc-store get --key myKey --email user@example.com

  $ sfp server doc-store get --key myKey --application-token myToken
```

*See code:* [*src/commands/server/doc-store/get.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server doc-store update`

Update a document in the doc store

```
USAGE
  $ sfp server doc-store update -k <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-v <value> | -f <value>] [-n <value>] [-u]

FLAGS
  -e, --email=<value>              [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                   --application-token is provided.
  -f, --file=<value>               Path to file to upload. JSON files will be parsed, other files will be base64 encoded
  -k, --key=<value>                (required) Key of the document to update
  -n, --current-version=<value>    Version of the document to update
  -t, --application-token=<value>  [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                   over --email.
  -u, --upsert                     Create document if it does not exist, otherwise update it
  -v, --value=<value>              New value for the document (must be valid JSON)
      --repository=<value>         The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>     [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                   `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update a document in the doc store

EXAMPLES
  $ sfp server doc-store update --key myKey --value '{"data": "value"}' --current-version 1 --email user@example.com

  $ sfp server doc-store update --key myKey --value '{"data": "value"}' --current-version 1 --application-token myToken

  $ sfp server doc-store update --key myKey --file ./data.json --current-version 1 --email user@example.com

  $ sfp server doc-store update --key myKey --file ./image.png --upsert --email user@example.com
```

*See code:* [*src/commands/server/doc-store/update.ts*](https://source.flxbl.io/flxbl/sfp-pro)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/cli-reference-v50-and-below/server/doc-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
