4747)
4848from redis .utils import (
4949 deprecated_function ,
50+ experimental_args ,
51+ experimental_method ,
5052 extract_expire_flags ,
5153)
5254
@@ -1729,6 +1731,7 @@ def delete(self, *names: KeyT) -> ResponseT:
17291731 def __delitem__ (self , name : KeyT ):
17301732 self .delete (name )
17311733
1734+ @experimental_method ()
17321735 def delex (
17331736 self ,
17341737 name : KeyT ,
@@ -1740,10 +1743,17 @@ def delex(
17401743 """
17411744 Conditionally removes the specified key.
17421745
1743- ifeq match-value - Delete the key only if its value is equal to match-value
1744- ifne match-value - Delete the key only if its value is not equal to match-value
1745- ifdeq match-digest - Delete the key only if the digest of its value is equal to match-digest
1746- ifdne match-digest - Delete the key only if the digest of its value is not equal to match-digest
1746+ Warning:
1747+ **Experimental** since 7.1.
1748+ This API may change or be removed without notice.
1749+ The API may change based on feedback.
1750+
1751+ Arguments:
1752+ name: KeyT - the key to delete
1753+ ifeq match-valu: Optional[Union[bytes, str]] - Delete the key only if its value is equal to match-value
1754+ ifne match-value: Optional[Union[bytes, str]] - Delete the key only if its value is not equal to match-value
1755+ ifdeq match-digest: Optional[str] - Delete the key only if the digest of its value is equal to match-digest
1756+ ifdne match-digest: Optional[str] - Delete the key only if the digest of its value is not equal to match-digest
17471757
17481758 Returns:
17491759 int: 1 if the key was deleted, 0 otherwise.
@@ -1878,10 +1888,19 @@ def expiretime(self, key: str) -> int:
18781888 """
18791889 return self .execute_command ("EXPIRETIME" , key )
18801890
1891+ @experimental_method ()
18811892 def digest (self , name : KeyT ) -> Optional [str ]:
18821893 """
18831894 Return the digest of the value stored at the specified key.
18841895
1896+ Warning:
1897+ **Experimental** since 7.1.
1898+ This API may change or be removed without notice.
1899+ The API may change based on feedback.
1900+
1901+ Arguments:
1902+ - name: KeyT - the key to get the digest of
1903+
18851904 Returns:
18861905 - None if the key does not exist
18871906 - (bulk string) the XXH3 digest of the value as a hex string
@@ -2385,6 +2404,7 @@ def restore(
23852404
23862405 return self .execute_command ("RESTORE" , * params )
23872406
2407+ @experimental_args (["ifeq" , "ifne" , "ifdeq" , "ifdne" ])
23882408 def set (
23892409 self ,
23902410 name : KeyT ,
@@ -2405,6 +2425,12 @@ def set(
24052425 """
24062426 Set the value at key ``name`` to ``value``
24072427
2428+ Warning:
2429+ **Experimental** since 7.1.
2430+ The usage of the arguments ``ifeq``, ``ifne``, ``ifdeq``, and ``ifdne``
2431+ is experimental. The API or returned results when those parameters are used
2432+ may change based on feedback.
2433+
24082434 ``ex`` sets an expire flag on key ``name`` for ``ex`` seconds.
24092435
24102436 ``px`` sets an expire flag on key ``name`` for ``px`` milliseconds.
0 commit comments