Thanks to the answer here, I manged to get all the rows that contain a given string as a substring of a specific field's value by:
r.db('my_db').table('my_table').filter(lambda row: row['some_key'].match(".\*some_given_string.\*"))
What if I want to have a similar result, but this time, "some_key" is a list of strings instead of a single string? Say for the following table:
[{"name": "row1", "some_key": ["str1", "str2"]}, {"name": "row2", "some_key": ["str3", "blah"]}, {"name": "row3", "some_key": ["blah", "blahblah"]}]
I want to look for ".*tr.*"
and get the first two rows only because the last one has a list under "some_key" that doesn't contain "tr" in none of its strings.
How can I do that with rethinkdb?