Golang with rethinkDB

RethinkDB is an open source distributed data source for realtime web apps with JSON based document. RethinkDB has intuitive query language, parallelized queries, and simple administration tools.
rethinkDB also has modern web UI. located in http://localhost:8080 if you install in local environment.

rethinkDB has its own query language called reQL, rethinkDB query language.
in this post we will explore how to interact rethinkDB with Go language.
first you have to install rethinkDB and follow this instruction :
https://rethinkdb.com/docs/install/
make sure rethinkDB is up & running
Connect to rethinkDB
Create table
create table in rethinkDB. open rethinkDB WEB UI. click the table menu & create your table.
Insert data
create rethinkDB session struct to reuse the session and create user struct for user data.
create function to insert data to user table
Get All Data
now let’s create a function to fetch user data from rethinkDB.
in this function we fetch data from rethinkDB and bind it to user struct and iterate it. you can use filter with this method after .Table()
method.
Delete Data
to delete data by ID in rethinkDB with Go.
wrap it up:
in the next part. we will explore how we fetch data from rethinkDB in realtime.