run the rethinkdb database in another tab of your terminal and then run the code here.
rethinkdb
you can find some of the commands here:
- create db
r.db('python_tutorial').table_create('heroes').run()
- get all db names
r.db_list().run()
- create table
r.db('python_tutorial').table('heroes')
- insert to a table
table_variable_name.insert([
{},
{},
{}
]).run()
- update values
heroes.update({
'appearances_count': r.row['appearances_count'] + 1
}).run()
- filter table rows based on some value
table_variable_name.filter(r.row['appearances_count'] >= 100).run()
- get a value by its id
table_variable_name.get('d7d5e949-3f71-4e21-b5b7-42b6e7048ea3').run()
- delete all things that have some value
r.table("comments").filter({"id_post": 3}).delete().run(conn)