0

I use Python client driver and the structure of my documents is :

{"key1": ["value1"], "key2": ["value2"], ..., "key7": ["value7"]}

let say "value7" is "In every time in every place, deeds of men remain the same"

I'd like to retrieve all documents that contain "deed" for key7.

I tried

r.db('db')
 .table('table')
 .filter(lambda row: row['key7'].match('^deed'))
 .run(conn)

but it doesn't work... I have the follwing message :

rethinkdb.errors.ReqlQueryLogicError: Expected type STRING but found ARRAY

crocefisso
  • 793
  • 2
  • 14
  • 29

1 Answers1

0

Here is the solution :

r.db('db')
 .table('table')
 .filter(lambda row: row['key7'].nth(0).match('^deed'))
 .run(conn)
crocefisso
  • 793
  • 2
  • 14
  • 29