BlueForge Docs

client.redis.del

Delete a RedisOS key.

Signature

class Client {
  redis: {
    del(key: string): Promise<boolean>
  }
}

Parameters

NameTypeRequiredNotes
key
stringyesRedis key name

Returns

true
if the key existed and was deleted,
false
if the key did not exist.

Examples

const deleted = await bf.redis.del('session:abc123')
console.log(deleted ? 'Deleted' : 'Key not found')

Throws

ErrorCondition
ApiError
API request failed
NetworkError
Network issue

Pitfalls

  • Non-existent keys — deleting a key that doesn't exist returns
    false
    , not an error
  • Irreversible — there is no undo for
    del

See also

{auto-injected}

Tested against

{auto-injected}