Search code examples
pythonrethinkdbrethinkdb-python

Want to update document in reThinkDB using setInsert Python


   r.db('usersData').table('smsRaw').get("3413b71c-1628-47eb-83fa-6a3cccdb3e62").update({"MESSAGE": r.row('MESSAGE').setInsert({"DATE":"20160111","MESSAGE":[{"ADDR":"LONDON","date":"1468385398746"}]})})

This is what i am able to run on console.I want to convert it to python code.

Below is python code i tried r.db(dbName).table(tableName).get(id).update({'MESSAGE':r.row.get_field('MESSAGE').setInsert(Doc)}).run(con)

its throwing exception. AttributeError 'GetField' object has no attribute 'setInsert


Solution

  • You probably want setInsert to be set_insert.