Skip to content

RPOP and LPOP do not support count argument #2668

Closed
@ajmichels

Description

@ajmichels

Motivation

In Redis v6.2 a second argument was added to the RPOP and LPOP commands that allows for specifying a count of items that should be attempted to fetch from a list. It doesn't look like this support has been added to the library yet. Without these extra arguments is the necessary to perform a multi-command request. I realize it is possible to use client.sendCommand(['RPOP', 'key', '10']), I am just not sure what this project's stance is on feature parity.

Adding support for this would require that RPOP and LPOP return different data types (string or array) depending on the arguments given.

Basic Code Example

await client.RPOP('myKey');
// 'value'

await client.RPOP('myKey', 1);
// ['value']

await client.RPOP('myKey', 2);
// ['value1', 'value2']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions