kevy4.0

LPOS

Return the index of matching elements in a list.

LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len]
Group
List
Since
1.0.0
Arity
at least 3
Flags
readonly

Complexity

O(N) always — the whole list is copied before RANK / COUNT / MAXLEN are applied, so MAXLEN bounds the comparisons but not the copy

Complexity and compatibility are read out of kevy's implementation, not copied from Redis's reference. Several genuinely differ.

Redis compatibility

Compatible

Behaves as Redis does.

See also

BLPOPBRPOPBRPOPLPUSHLINDEXLLENLMOVELPOPLPUSHLRANGELREMLSETLTRIMRPOPRPOPLPUSHRPUSH

← All commands