RedisDatabase.setNX

Set the value of a key, only if the key does not exist, and also set the specified expire time using D notation, e.g. 5.minutes for 5 minutes.

  1. bool setNX(string key, T value)
  2. bool setNX(string key, T value, Duration expire_time)
    struct RedisDatabase
    bool
    setNX
    (
    T
    )
    (
    string key
    ,,
    Duration expire_time
    )

Meta