redis / docs

Documentation for Redis, Redis Cloud, and Redis Enterprise
https://redis.io/docs/latest/
Other
23 stars 133 forks source link

Feedback: Redis hashes #924

Open ArnabhS opened 2 days ago

ArnabhS commented 2 days ago

For nodejs implementation some letters of functions are in Captial letters which is not right. All letters of the function name should be in small letters.

eg: await client.hGet('bike:1','model') actual: await client.hget('bike:1','model')

dwdougherty commented 16 hours ago

Hi @ArnabhS . Thank you for reaching out. Here's what the node-redis documentation has to say:

Redis Commands

There is built-in support for all of the out-of-the-box Redis commands. They are exposed using the raw Redis command names (HSET, HGETALL, etc.) and a friendlier camel-cased version (hSet, hGetAll, etc.):

// raw Redis commands
await client.HSET('key', 'field', 'value');
await client.HGETALL('key');

// friendly JavaScript commands
await client.hSet('key', 'field', 'value');
await client.hGetAll('key');

Further, if you look at the test code, you'll see that camel-case is used pretty much everywhere. Here's the test code for HGET:

  ...
  testUtils.testAll('hGet', async client => {
    assert.equal(
      await client.hGet('key', 'field'),
      null
    );
  },
  ...

https://github.com/redis/node-redis/blob/master/packages/client/lib/commands/HGET.spec.ts