Skip to content

arrindex returns -1 when finding the last value in the array (and when start and stop are not specified) #2481

Closed
@ajavia

Description

@ajavia

Version: redis-py 4.1.4, redis 6.2.7

Platform: Python 3.10.5 on MacOS 12.6.1

Description: When using arrindex, the behavior for finding the last element of the array, and finding no element in the array is the same when default start and stop are unspecified.

For example, I have an array ['test', 'test2' and 'test3']

When executing

redis_client.json().arrindex(f'type:key','arr_name','test3')

redis_client.json().arrindex(f'type:key','arr_name','test4')

The response is the same [-1].

It works fine when I search

redis_client.json().arrindex(f'type:key','arr_name','test3',start=0, stop=1000000)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions