Arguments
string
required
The key of the hash.
string
required
The name of the field.
TValue
required
Any value, if it’s not a string it will be serialized to JSON.
Response
1 if the field was set, 0 if it already existed.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
await redis.hsetnx("key", "id", 1)
Write a field to a hash but only if the field does not exist.
1 if the field was set, 0 if it already existed.await redis.hsetnx("key", "id", 1)
Was this page helpful?