Back to top

ReQL command: offsets_of

Command syntax

sequence.offsets_of(datum | predicate_function) → array


Get the indexes of an element in a sequence. If the argument is a predicate, get the indexes of all elements matching it.

Example: Find the position of the letter ā€˜cā€™.


Example: Find the popularity ranking of invisible heroes.

    |row| row[:superpowers].contains('invisibility')

Get more help

Couldn't find what you were looking for?