Skip to content

docs: Add HTTL command reference page#513

Merged
romange merged 6 commits intomainfrom
copilot/add-docs-for-httl-command
Mar 20, 2026
Merged

docs: Add HTTL command reference page#513
romange merged 6 commits intomainfrom
copilot/add-docs-for-httl-command

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Adds documentation for HTTL, a read-only command that returns the remaining TTL in seconds for individual fields within a hash — filling a gap where only key-level TTL existed before.

Changes

  • docs/command-reference/hashes/httl.md — New command reference covering:
    • Syntax: HTTL key FIELDS numfields field [field ...]
    • Return semantics: -2 (field/key missing), -1 (no expiry), positive int (remaining TTL)
    • Examples: fields with/without expiry, non-existent key, wrong type error
    • Notes on read-only behavior and relation to HEXPIRE/HSETEX
    • Links to related hash TTL commands

Example

dragonfly> HSET myhash field1 "hello" field2 "world"
(integer) 2
dragonfly> HEXPIRE myhash 30 FIELDS 1 field1
1) (integer) 1
dragonfly> HTTL myhash FIELDS 3 field1 field2 nosuchfield
1) (integer) 29
2) (integer) -1
3) (integer) -2
Original prompt

Add a new documentation page describing the HTTL command, introduced in dragonflydb/dragonfly PR #6879 (dragonflydb/dragonfly#6879). This command allows querying the TTL (Time-To-Live) of individual fields within Redis hash objects. The documentation must include:

  • A clear explanation of what HTTL does and when developers might need it.
  • Syntax, usage examples (with inputs/outputs) and a breakdown of parameters.
  • Comparison to existing Redis TTL commands and explanation of how HTTL addresses hash limitations.
  • Edge case handling, including usage with non-existent hashes or fields.
  • Version and compatibility details (when it landed, whether it's unique to Dragonfly, etc.).
  • Performance and practical implications (bulk queries, scripting, latency).
  • Links to related documentation or blog posts.

Style must be consistent with the rest of the documentation: clear, objective, with signposting and progressive disclosure, and accessible for both junior and senior developers. Begin with a concise summary that motivates use of HTTL for granular cache management. End with key takeaways and cross-references to broader TTL concepts.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: @dragonflydb/dragonfly/pull/6879
add documentation page based on the attached PR into https://github.com/dragonflydb/documentation/

Assistant: Absolutely — great idea.

I can help draft the docs content, but to actually add it into dragonflydb/documentation I’ll need to open a PR there.

If you want me to do that now, please confirm and I’ll create a PR in:

  • dragonflydb/documentation

based on:

  • https://github.com/dragonflydb/dragonfly/pull/6879 (“Add HTTL command for hash field TTL queries”)

I can include:
1.

User: @dragonflydb/dragonfly/pull/6879
add documentation page based on the attached PR into https://github.com/dragonflydb/documentation/

Assistant: I'm preparing a documentation page for the HTTL command as introduced in PR #6879, which will be added to https://github.com/dragonflydb/documentation/.

Once the PR is ready, I'll present a draft of the documentation for your review, covering usage, syntax, comparisons, edge cases, and more, as specified.

This pull request was created from Copilot chat.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment Mar 15, 2026 10:04pm

Request Review

Co-authored-by: romange <3674760+romange@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation page for HTTL command docs: Add HTTL command reference page Mar 13, 2026
Copilot AI requested a review from romange March 13, 2026 14:08
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
@romange romange marked this pull request as ready for review March 15, 2026 18:09
@romange romange requested a review from BorysTheDev March 15, 2026 18:09
Co-authored-by: romange <3674760+romange@users.noreply.github.com>
@romange romange requested a review from kostasrim March 20, 2026 11:06
Copy link
Contributor

@kostasrim kostasrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@romange romange merged commit 0ce4e3e into main Mar 20, 2026
3 checks passed
@romange romange deleted the copilot/add-docs-for-httl-command branch March 20, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants