1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

DOC-4423: add TCEs for various command pages (#2885)

* DOC-4423: add TCEs for various command pages

* fix problematic doctest

from redis docs for ACL DELUSER:
Delete all the specified ACL users and terminate all the connections
 that are authenticated with such users

Nodejs complains: Warning: Detected unsettled top-level await
which in turn gives the error code 13 in the workflow

await client.auth({ username: 'test-user' ...});
// deleting the user that is currently logged in -> bad
await client.sendCommand(['ACL', 'DELUSER', 'test-user']);
await client.quit()

fix: authenticate with the default user before deleting the test-user

---------

Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
This commit is contained in:
David Dougherty
2025-04-22 07:50:35 -07:00
committed by GitHub
parent 001087f520
commit cb26059e5d
5 changed files with 306 additions and 1 deletions

View File

@@ -65,7 +65,45 @@ await client.del('myhash')
// REMOVE_END
// STEP_END
// STEP_START hgetall
const res10 = await client.hSet(
'myhash',
{
'field1': 'Hello',
'field2': 'World'
}
)
const res11 = await client.hGetAll('myhash')
console.log(res11) // [Object: null prototype] { field1: 'Hello', field2: 'World' }
// REMOVE_START
assert.deepEqual(res11, {
field1: 'Hello',
field2: 'World'
});
await client.del('myhash')
// REMOVE_END
// STEP_END
// STEP_START hvals
const res12 = await client.hSet(
'myhash',
{
'field1': 'Hello',
'field2': 'World'
}
)
const res13 = await client.hVals('myhash')
console.log(res13) // [ 'Hello', 'World' ]
// REMOVE_START
assert.deepEqual(res13, [ 'Hello', 'World' ]);
await client.del('myhash')
// REMOVE_END
// STEP_END
// HIDE_START
await client.quit();
// HIDE_END