-1

I have installed rethinkdb on my local machine and the Python driver.However Im unable to access a database I want..The name of the database is "authors" and the table is "books".

I initially open the connection:

 r.connect(host = 'localhost',port = 28015).repl()

The connection is successful

Then I run the following command:

 r.db('authors).table('books').count()

I get the error "db authors doesnt exist"...I have tried a few different queries but get the same error (However if I want to create a new database I am able to do so-Im only unable to access already existing databases).

ashwin shanker
  • 303
  • 1
  • 7
  • 20

1 Answers1

0

You need to create your database and your table. RethinkDB doesn't automatically create them for you.

r.db_create("authors").run()
r.db("authors").table_create("books").run()
r.db("authors").table("books").count()
neumino
  • 4,342
  • 1
  • 18
  • 17