Now that we have a RethinkDB installation up and running, let's give it a quick try to make sure that everything is set up correctly. There are a few things that you might want to try to ensure that your database is running correctly. The first step is to try and access the web interface by browsing http://127.0.0.1:8080
.
If everything is working correctly, you'll see the RethinkDB web interface:
The web interface allows you to view the status of your cluster and manage each server independently. In the main view, we can see some standard health checks and cluster performance metrics, whereas at the bottom, we can find the most recently logged activities.
If we click on the Tables link at the top of the page, we can see all the tables that we have added to our database:
From this page, we can see all the databases that we have in the cluster. Within each database, we can see all the tables that we have created. As you can see from this screenshot, the cluster currently contains one database called test but no tables.
The web interface also provides a Data Explorer page that we can use to learn the query language and execute queries. If we click on the Data Explorer link, we are given an interface that allows us to interact with the server using the query language.
You now have an interactive shell at which you can issue commands. So, let's run our first query! Insert the following query into the Data Explorer:
r.db('test').tableCreate('people')
This simple query creates a table called people
inside the test
database. If you execute the query by pressing the Run button, RethinkDB will create a new table and acknowledge the operation with a JSON document. As you can see, the Data Explorer is really easy to use and provides us with a great tool for high-level management of our databases and clusters.
Congratulations, you've just executed your first ReQL query! You'll get to learn the ReQL query language much better in the following chapter.
Downloading the example code
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
18.222.111.243