Q:

insert statement in rethinkdb and python

#pip3 install rethinkdb

from rethinkdb import r

connection = r.connect()
r.db_create('superheroes').run(connection)


r.table_create('marvel').run(connection)

marvel_heroes = r.table('marvel')
marvel_heroes.insert({
    'id': 1,
    'name': 'Iron Man',
    'first_appearance': 'Tales of Suspense #39'}).run(connection)

for hero in marvel_heroes.run(connection):
    print(hero['name'])
0

New to Communities?

Join the community