Skip to main content

Get-ZrItem

Reads a single item from the connected Zaris store by key, returning its value along with revision, version, and remaining TTL. A missing key is reported as Exists = false rather than an error.

Syntax

Get-ZrItem [-Key] <string>
[-ConnectionString <string>] [-StoreName <string>] [-Endpoints <string[]>] [-TimeoutSec <int>]

Description

Get-ZrItem fetches the value stored under the given key. It requires an active connection opened with Connect-ZrStore, or the independent -StoreName/-Endpoints parameters for a one-shot connection.

If the key does not exist, the cmdlet returns Exists = false with Success = true — a missing key is not an error. Transport failures are reported with Success = false and an Error message. Press Ctrl+C to cancel safely.

The returned object has StoreName, Key, Exists, Value, Revision, Version, TtlSec, Success, and Error.

Parameters

ParameterTypeRequiredDescription
-KeyStringYesThe key identifying the item to read. Position 0. Must be non-null and non-empty.
-ConnectionStringStringNoConnect via a Zaris connection string, e.g. zaris://host:7861/store; an alternative to -StoreName + -Endpoints for a one-shot connection. Ignored when a Connect-ZrStore session is active.
-StoreNameStringNoStore to operate on for a one-shot (independent) connection instead of the active session. Requires -Endpoints; ignored when a Connect-ZrStore session is active.
-EndpointsString[]NoOne or more host:port endpoints for a one-shot connection. Ignored when a session is active.
-TimeoutSecInt32NoConnection timeout in seconds for a one-shot connection. Range 1–120. Default 5.

Examples

Read an item from the connected store:

Get-ZrItem -Key "order:1001"

Read an item using a one-shot connection, without Connect-ZrStore:

Get-ZrItem -Key "order:1001" -ConnectionString "zaris://10.0.0.11:7861/OrdersStore"