Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@
"pages": [
"redis/sdks/ts/commands/hash/hdel",
"redis/sdks/ts/commands/hash/hexists",
"redis/sdks/ts/commands/hash/hexpire",
"redis/sdks/ts/commands/hash/hexpireat",
"redis/sdks/ts/commands/hash/hexpiretime",
"redis/sdks/ts/commands/hash/hget",
"redis/sdks/ts/commands/hash/hgetall",
"redis/sdks/ts/commands/hash/hincrby",
Expand All @@ -246,8 +249,14 @@
"redis/sdks/ts/commands/hash/hrandfield",
"redis/sdks/ts/commands/hash/hscan",
"redis/sdks/ts/commands/hash/hset",
"redis/sdks/ts/commands/hash/hpersist",
"redis/sdks/ts/commands/hash/hpexpire",
"redis/sdks/ts/commands/hash/hpexpireat",
"redis/sdks/ts/commands/hash/hpexpiretime",
"redis/sdks/ts/commands/hash/hpttl",
"redis/sdks/ts/commands/hash/hsetnx",
"redis/sdks/ts/commands/hash/hstrlen",
"redis/sdks/ts/commands/hash/httl",
"redis/sdks/ts/commands/hash/hvals"
]
},
Expand Down Expand Up @@ -465,6 +474,9 @@
"pages": [
"redis/sdks/py/commands/hash/hdel",
"redis/sdks/py/commands/hash/hexists",
"redis/sdks/py/commands/hash/hexpire",
"redis/sdks/py/commands/hash/hexpireat",
"redis/sdks/py/commands/hash/hexpiretime",
"redis/sdks/py/commands/hash/hget",
"redis/sdks/py/commands/hash/hgetall",
"redis/sdks/py/commands/hash/hincrby",
Expand All @@ -475,9 +487,15 @@
"redis/sdks/py/commands/hash/hrandfield",
"redis/sdks/py/commands/hash/hscan",
"redis/sdks/py/commands/hash/hset",
"redis/sdks/py/commands/hash/hpersist",
"redis/sdks/py/commands/hash/hpexpire",
"redis/sdks/py/commands/hash/hpexpireat",
"redis/sdks/py/commands/hash/hpexpiretime",
"redis/sdks/py/commands/hash/hpttl",
"redis/sdks/py/commands/hash/hmset",
"redis/sdks/py/commands/hash/hsetnx",
"redis/sdks/py/commands/hash/hstrlen",
"redis/sdks/py/commands/hash/httl",
"redis/sdks/py/commands/hash/hvals"
]
},
Expand Down
55 changes: 55 additions & 0 deletions redis/sdks/py/commands/hash/hexpire.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: HEXPIRE
description: Set a timeout on a hash field in seconds.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields within the hash to set the expiry for.
</ParamField>

<ParamField body="seconds" type="Union[int, datetime.timedelta]" required>
The timeout in seconds as an integer or a `datetime.timedelta` object.
</ParamField>

<ParamField body="nx" type="bool" optional>
Set expiry only when the field has no expiry. Defaults to `False`.
</ParamField>

<ParamField body="xx" type="bool" optional>
Set expiry only when the field has an existing expiry. Defaults to `False`.
</ParamField>

<ParamField body="gt" type="bool" optional>
Set expiry only when the new expiry is greater than the current one. Defaults to `False`.
</ParamField>

<ParamField body="lt" type="bool" optional>
Set expiry only when the new expiry is less than the current one. Defaults to `False`.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers indicating whether the expiry was successfully set.

- `-2` if the field does not exist in the hash or if key doesn't exist.
- `0` if the expiration was not set due to the condition.
- `1` if the expiration was successfully set.
- `2` if called with 0 seconds/milliseconds or a past Unix time.

For more details, see [HEXPIRE documentation](https://redis.io/commands/hexpire).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)

assert redis.hexpire(hash_name, field, 1) == [1]
```
</RequestExample>
55 changes: 55 additions & 0 deletions redis/sdks/py/commands/hash/hexpireat.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: HEXPIREAT
description: Sets an expiration time for field(s) in a hash in seconds since the Unix epoch.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields to set an expiration time for.
</ParamField>

<ParamField body="timestamp" type="int" required>
The expiration time as a Unix timestamp in seconds.
</ParamField>

<ParamField body="nx" type="bool" optional>
Set expiry only when the field has no expiry. Defaults to `False`.
</ParamField>

<ParamField body="xx" type="bool" optional>
Set expiry only when the field has an existing expiry. Defaults to `False`.
</ParamField>

<ParamField body="gt" type="bool" optional>
Set expiry only when the new expiry is greater than the current one. Defaults to `False`.
</ParamField>

<ParamField body="lt" type="bool" optional>
Set expiry only when the new expiry is less than the current one. Defaults to `False`.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers indicating whether the expiry was successfully set.

- `-2` if the field does not exist in the hash or if the key doesn't exist.
- `0` if the expiration was not set due to the condition.
- `1` if the expiration was successfully set.
- `2` if called with 0 seconds/milliseconds or a past Unix time.

For more details, see [HEXPIREAT documentation](https://redis.io/commands/hexpireat).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)

assert redis.hexpireat(hash_name, field, int(time.time()) + 10) == [1]
```
</RequestExample>
34 changes: 34 additions & 0 deletions redis/sdks/py/commands/hash/hexpiretime.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: HEXPIRETIME
description: Retrieves the expiration time of field(s) in a hash in seconds.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields to retrieve the expiration time for.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers representing the expiration time in seconds since the Unix epoch.

- `-2` if the field does not exist in the hash or if the key doesn't exist.
- `-1` if the field exists but has no associated expiration.

For more details, see [HEXPIRETIME documentation](https://redis.io/commands/hexpiretime).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)
redis.hexpireat(hash_name, field, int(time.time()) + 10)

assert redis.hexpiretime(hash_name, field) == [1697059200]
```
</RequestExample>
1 change: 0 additions & 1 deletion redis/sdks/py/commands/hash/hkeys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ redis.hset("myhash", values={
})

assert redis.hkeys("myhash") == ["field1", "field2"]

```
</RequestExample>
35 changes: 35 additions & 0 deletions redis/sdks/py/commands/hash/hpersist.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: HPERSIST
description: Remove the expiration from one or more hash fields.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields within the hash to remove the expiry from.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers indicating the result for each field:

- `-2` if the field does not exist in the hash or if the key doesn't exist.
- `-1` if the field exists but has no associated expiration set.
- `1` if the expiration was successfully removed.

For more details, see [HPERSIST documentation](https://redis.io/commands/hpersist).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)
redis.hpexpire(hash_name, field, 1000)

assert redis.hpersist(hash_name, field) == [1]
```
</RequestExample>
55 changes: 55 additions & 0 deletions redis/sdks/py/commands/hash/hpexpire.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: HPEXPIRE
description: Set a timeout on a hash field in milliseconds.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields within the hash to set the expiry for.
</ParamField>

<ParamField body="milliseconds" type="Union[int, datetime.timedelta]" required>
The timeout in milliseconds as an integer or a `datetime.timedelta` object.
</ParamField>

<ParamField body="nx" type="bool" optional>
Set expiry only when the field has no expiry. Defaults to `False`.
</ParamField>

<ParamField body="xx" type="bool" optional>
Set expiry only when the field has an existing expiry. Defaults to `False`.
</ParamField>

<ParamField body="gt" type="bool" optional>
Set expiry only when the new expiry is greater than the current one. Defaults to `False`.
</ParamField>

<ParamField body="lt" type="bool" optional>
Set expiry only when the new expiry is less than the current one. Defaults to `False`.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers indicating whether the expiry was successfully set.

- `-2` if the field does not exist in the hash or if key doesn't exist.
- `0` if the expiration was not set due to the condition.
- `1` if the expiration was successfully set.
- `2` if called with 0 seconds/milliseconds or a past Unix time.

For more details, see [HPEXPIRE documentation](https://redis.io/commands/hpexpire).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)

assert redis.hpexpire(hash_name, field, 1000) == [1]
```
</RequestExample>
55 changes: 55 additions & 0 deletions redis/sdks/py/commands/hash/hpexpireat.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: HPEXPIREAT
description: Sets an expiration time for field(s) in a hash in milliseconds since the Unix epoch.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields to set an expiration time for.
</ParamField>

<ParamField body="timestamp" type="int" required>
The expiration time as a Unix timestamp in milliseconds.
</ParamField>

<ParamField body="nx" type="bool" optional>
Set expiry only when the field has no expiry. Defaults to `False`.
</ParamField>

<ParamField body="xx" type="bool" optional>
Set expiry only when the field has an existing expiry. Defaults to `False`.
</ParamField>

<ParamField body="gt" type="bool" optional>
Set expiry only when the new expiry is greater than the current one. Defaults to `False`.
</ParamField>

<ParamField body="lt" type="bool" optional>
Set expiry only when the new expiry is less than the current one. Defaults to `False`.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers indicating whether the expiry was successfully set.

- `-2` if the field does not exist in the hash or if the key doesn't exist.
- `0` if the expiration was not set due to the condition.
- `1` if the expiration was successfully set.
- `2` if called with 0 seconds/milliseconds or a past Unix time.

For more details, see [HPEXPIREAT documentation](https://redis.io/commands/hpexpireat).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)

assert redis.hpexpireat(hash_name, field, int(time.time() * 1000) + 1000) == [1]
```
</RequestExample>
34 changes: 34 additions & 0 deletions redis/sdks/py/commands/hash/hpexpiretime.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: HPEXPIRETIME
description: Retrieves the expiration time of a field in a hash in milliseconds.
---

## Arguments

<ParamField body="key" type="str" required>
The key of the hash.
</ParamField>

<ParamField body="fields" type="Union[str, List[str]]" required>
The field or list of fields to retrieve the expiration time for.
</ParamField>

## Response

<ResponseField type="List[int]" required>
A list of integers representing the expiration time in milliseconds since the Unix epoch.

- `-2` if the field does not exist in the hash or if the key doesn't exist.
- `-1` if the field exists but has no associated expiration.

For more details, see [HPEXPIRETIME documentation](https://redis.io/commands/hpexpiretime).
</ResponseField>

<RequestExample>
```py Example
redis.hset(hash_name, field, value)
redis.hpexpireat(hash_name, field, int(time.time() * 1000) + 1000)

assert redis.hpexpiretime(hash_name, field) == [1697059200000]
```
</RequestExample>
Loading