Skip to content

Add support for CAS/CAD commands #3498

@a-TODO-rov

Description

@a-TODO-rov

SET:

Set the key only when a specified condition is met

Options:

  • IFEQ match-value - Set the key’s value and expiration only if its current value is equal to match-value. If the key doesn’t exist, it won’t be created
  • IFNE match-value - Set the key’s value and expiration only if its current value is not equal to match-value. If the key doesn’t exist, it will be created
  • IFDEQ match-digest - Set the key’s value and expiration only if the digest of its current value is equal to match-digest. If the key doesn’t exist, it won’t be created
  • IFDNE match-digest - Set the key’s value and expiration only if the digest of its current value is not equal to match-digest. If the key doesn’t exist, it will be created

Reply:

  • If GET was not specified, any of the following:
    • Nil reply if either
      • the key does not exist and XX/IFEQ/IFDEQ was specified. The key was not created.
      • the key exists and NX was specified or a specified IFEQ/IFNE/IFDEQ/IFDNE condition is false. The key was not set.
    • Simple string reply: OK: The key was set.
  • If GET was specified, any of the following:
    • Nil reply: The key didn't exist before the SET.
    • Bulk string reply: The previous value of the key (Regardless of the conditional IFEQ/IFNE/IFDEQ/IFDNE results).

DELEX:

Removes the specified key and optionally applies only when a specified condition is met

Options:

  • IFEQ match-value - Only delete the key if match-value equals the current value
  • IFNE match-value - Only delete the key if match-value does not equal the current value
  • IFDEQ match-digest - Only delete the key if match-digest equals the current digest value
  • IFDNE match-digest - Only delete the key if match-digest does not equal the current digest value

Reply:
Integer reply: the number of keys that were removed

DIGEST

Return a hex signature of the value stored in the specified key.

Reply:

  • Bulk string reply: the hex signature of the key or null if the key does not exist
  • Simple error reply: the command returns an error if the key is not a string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions