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ā.
r.expr(['a','b','c']).offsets_of('c').run(conn)
Example: Find the popularity ranking of invisible heroes.
r.table('marvel').union(r.table('dc')).order_by('popularity').offsets_of(
r.row['superpowers'].contains('invisibility')
).run(conn)
Couldn't find what you were looking for?
Contribute: edit this page or open an issue