Get-ZrItemMetadata
Reads an item's bookkeeping — revision, version, remaining TTL, and attached metadata — without returning its value. A missing key is reported as Exists = false.
Syntax
Get-ZrItemMetadata [-Key] <string> [-ConnectionString <string>] [-StoreName <string>] [-Endpoints <string[]>] [-TimeoutSec <int>]
Description
Get-ZrItemMetadata fetches the metadata for the item stored under -Key from the connected Zaris store. It returns the revision, version, remaining time-to-live, and any attached metadata dictionary, without surfacing the stored value itself. This is useful for diagnostics: inspecting version/revision state, checking TTL, or auditing entries.
When the key exists, the result reports Exists = true, Success = true, and the metadata fields. When the key is missing, it reports Exists = false and Success = false rather than raising an error.
The command runs against the active Connect-ZrStore session, or against a one-shot connection when -StoreName and -Endpoints are supplied.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Key | String | Yes | Key identifying the item whose metadata to read. Positional (position 0). Must not be null or empty. |
-ConnectionString | String | No | Connect 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. |
-StoreName | String | No | Store to target when using an independent (one-shot) connection instead of the active session. Requires -Endpoints. |
-Endpoints | String[] | No | One or more node endpoints (host:port) for an independent connection. Ignored when a Connect-ZrStore session is active. |
-TimeoutSec | Int32 | No | Connection timeout in seconds (1–120) for an independent connection. Default 5. |
Examples
Read the revision, version, TTL, and metadata for an item:
Get-ZrItemMetadata -Key "user:42"
Inspect an order entry's metadata using the positional key:
Get-ZrItemMetadata "order:1001"