LPOS

Finds the position of a matching list element.

Lists · Example verified

Syntax covered here

LPOS key element

The plain form reports a zero-based position for an element present once in the list.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> RPUSH queue a b c
3
# connection: default
> LPOS queue b
1