tuple_object:find(), tuple_object:findall()
-
object
tuple_object¶ -
tuple_object:find([field-number, ]search-value)¶ -
tuple_object:findall([field-number, ]search-value)¶ If
tis a tuple instance,t:find(search-value)will return the number of the first field intthat matches the search value, andt:findall(search-value [, search-value ...])will return numbers of all fields intthat match the search value. Optionally one can put a numeric argumentfield-numberbefore the search-value to indicate “start searching at field numberfield-number.”Return: the number of the field in the tuple. Rtype: number In the following example, a tuple named
tis created and then: the number of the first field intwhich matches ‘a’ is returned, then the numbers of all the fields intwhich match ‘a’ are returned, then the numbers of all the fields in t which match ‘a’ and are at or after the second field are returned.tarantool> t = box.tuple.new{'a', 'b', 'c', 'a'} --- ... tarantool> t:find('a') --- - 1 ... tarantool> t:findall('a') --- - 1 - 4 ... tarantool> t:findall(2, 'a') --- - 4 ...
-