Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with RethinkDB

You're reading from   Getting Started with RethinkDB Absorb the knowledge required to utilize, manage, and deploy

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher Packt
ISBN-13 9781785887604
Length 176 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Gianluca Tiepolo Gianluca Tiepolo
Author Profile Icon Gianluca Tiepolo
Gianluca Tiepolo
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Introducing RethinkDB FREE CHAPTER 2. The ReQL Query Language 3. Clustering, Sharding, and Replication 4. Performance Tuning and Advanced Queries 5. Programming RethinkDB in Node.js 6. RethinkDB Administration and Deployment 7. Developing Real-Time Web Applications Index

Running a query

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.

Tip

To access RethinkDB's web administration interface, you have to substitute 127.0.0.1 with the public IP that your instance is bound to.

If everything is working correctly, you'll see the RethinkDB web interface:

Running a query

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:

Running a query

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.

Running a query

Congratulations, you've just executed your first ReQL query! You'll get to learn the ReQL query language much better in the following chapter.

Tip

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:

  • Log in or register to our website using your e-mail address and password
  • Hover the mouse pointer on the SUPPORT tab at the top
  • Click on Code Downloads & Errata
  • Enter the name of the book in the Search box
  • Select the book which you're looking to download the code files
  • Choose from the drop-down menu where you purchased this book from
  • Click on Code Download

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux
You have been reading a chapter from
Getting Started with RethinkDB
Published in: Mar 2016
Publisher: Packt
ISBN-13: 9781785887604
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image