Ziggy - Services and Product Help

Data Store

Write to and read from the Data Store, a simple key/value pair data store. You can also access the Data Store from the Javascript Block as explained here.

Data store block

Overview

This Block takes data that arrives on the input edge and stores it in the Data Store.

  • You can specify the data path to the edge data that should be stored in the Key field.

  • Often, the edge data you want to store will be an array, in which case the array will be iterated over and each element will be stored against its own key. This means there must be a unique id in each array element.

  • If the edge data does not have a unique id, then you should leave the key field empty and a UUID will be generated for you.

Namespace and Key fields

Both the Namespace and the Key fields are required.

  • Namespace is either a string literal (no quotes) or can be created from a token (see below).

  • Key is derived from the input edge data and is the object data path. For example, id would use the id field from the input data (can be array) to generate the key. Se examples below.

Operation Type

The following operation types are available.

Create

There are three create modes. The mode is specified in the dropdown next the Operation Type dropdown.

  • Upsert: update the record if the key exists; otherwise create a new entry.

  • Create: create the record if it does not exist.

  • Error if exists: create a record if the key does not exist; throw an error if the key does exist.

Update

Update a record if the key exists.

Read

Fetches data from the store. Note that if Key is not specified, it will be treated as a Batch operation and the batch size should be specified.

The following shows the users namespace being fetched, 3 records at a time. Note that the input (Receiver test data) is an array.

Batch read array

The next example expects a string primitive on the input edge. We don't need to specify the Key for this as a result. The Batch size value is present but not relevant in this case.

Batch read primitive

Delete

Deletes the Key from the store.

Last modified: 10 February 2025