-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GETPXT (Get with millisecond expiration) command
Returns null if the value not found or expired. Returns an array of length 2 as [<string key value>, <integer expiration>]. If expiration is not set on the key, expiration returned is -1. Added tests to cover Signed-off-by: Arcadiy Ivanov <[email protected]>
- Loading branch information
Showing
5 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"GETPXT": { | ||
"summary": "Returns the string value of a key and the expiration time as a Unix milliseconds timestamp, if set.", | ||
"complexity": "O(1)", | ||
"group": "string", | ||
"since": "8.0.2", | ||
"arity": 2, | ||
"function": "getpxtCommand", | ||
"command_flags": [ | ||
"READONLY", | ||
"FAST" | ||
], | ||
"acl_categories": [ | ||
"STRING", | ||
"KEYSPACE" | ||
], | ||
"key_specs": [ | ||
{ | ||
"flags": [ | ||
"RO", | ||
"ACCESS" | ||
], | ||
"begin_search": { | ||
"index": { | ||
"pos": 1 | ||
} | ||
}, | ||
"find_keys": { | ||
"range": { | ||
"lastkey": 0, | ||
"step": 1, | ||
"limit": 0 | ||
} | ||
} | ||
} | ||
], | ||
"reply_schema": { | ||
"oneOf": [ | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "array", | ||
"minItems": 2, | ||
"maxItems": 2, | ||
"items": [ | ||
{ | ||
"description": "The value of the key.", | ||
"type": "string" | ||
}, | ||
{ | ||
"oneOf": [ | ||
{ | ||
"type": "integer", | ||
"description": "Expiration Unix timestamp in milliseconds.", | ||
"minimum": 0 | ||
}, | ||
{ | ||
"const": -1, | ||
"description": "The key exists but has no associated expiration time." | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"description": "Key does not exist.", | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"arguments": [ | ||
{ | ||
"name": "key", | ||
"type": "key", | ||
"key_spec_index": 0 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters