{
  "schema_version": 2,
  "id": "integrate/redis-data-integration/data-pipelines/transform-examples/redis-string-example",
  "title": "Write to a Redis string",
  "url": "https://redis.io/docs/latest/integrate/redis-data-integration/1.19.1/data-pipelines/transform-examples/redis-string-example/",
  "summary": "",
  "content": "\nThe string data type is useful for capturing a string representation of a single column from\na source table.\n\nIn the example job below, the `title` column is captured from the `album` table in the source.\nThe `title` is then written to the Redis target database as a string under a custom key of the\nform `AlbumTitle:42`, where the `42` is the primary key value of the table (the `albumid` column).\n\nThe `connection` is an optional parameter that refers to the corresponding connection name defined in\n[`config.yaml`](https://redis.io/docs/latest/integrate/redis-data-integration/1.19.1/data-pipelines/pipeline-config). \nWhen you specify the `data_type` parameter for the job, it overrides the system-wide setting `target_data_type` defined in `config.yaml`. Here, the `string` data type also requires an `args` subsection\nwith a `value` argument that specifies the column you want to capture from the source table.\n\nThe optional `expire` parameter sets the length of time, in seconds, that a new key will\npersist for after it is created (here, it is 86400 seconds, which equals one day).\nAfter this time, the key will be deleted automatically.\nIf you don't supply an `expire` parameter, the keys will never expire. \n\n```yaml\nname: Write album title to string\nsource:\n  table: album\n  row_format: full\noutput:\n  - uses: redis.write\n    with:\n      connection: target\n      data_type: string\n      key:\n        expression: concat(['AlbumTitle:', values(key)[0]])\n        language: jmespath\n      args:\n        value: title\n      expire: 86400\n```\n",
  "tags": ["docs","integrate","rs","rdi"],
  "last_updated": "2026-09-19T17:55:58-07:00"
}
