Answers for "insert statement in rethinkdb and python"

0

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'])
Posted by: Guest on October-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language