DEV Community

Cover image for Redisgraph - Deep Dive Part 1
Kisore Subburaman for DevParadise

Posted on • Edited on

Redisgraph - Deep Dive Part 1

RedisInsight

Hey guys! This is the second part of Redisgraph series. As we talked about RedisInsight earlier, it is a GUI for redis application. We can view the graphical representation of our data. Here, Install RedisInsight contains the steps for installation.
Once installed, run your redis server and redis insight, navigate to http://127.0.0.1:8001/. You will visit the home page of redis insight, there you can create a new database for your project as mentioned below.

Alt Text

Now, a database is created, you can navigate into it. In the sidebar, you can find Redisgraph, get into it. There, you can run commands and execute them. Both graphical and JSON notation of data is available.

CREATE

Alt Text

MATCH

Alt Text

Now, we can see some of the commands withdrawing the example we had from our last tutorial,

SKIP

It is used when we deal with batches of records.

syntax: SKIP [number of records to be skipped]

MATCH (e:emp) RETURN e SKIP 10;
Enter fullscreen mode Exit fullscreen mode

It skips the first 10 records and returns the rest.

LIMIT

It is used to limit the number of records.

syntax: LIMIT [maximum number of records to be retrieved]

MATCH (e:emp) RETURN e LIMIT 10;
Enter fullscreen mode Exit fullscreen mode

It returns only the first 10 records present.

SKIP and LIMIT together

MATCH (e:emp) RETURN e SKIP 10 LIMIT 10;
Enter fullscreen mode Exit fullscreen mode

It skips the first 10 records and lists the next 10.

ORDER BY

It denotes the sorting option [ASC/DESC]. We can specify how the records have to be sorted.

syntax: ORDER BY [field name] [ASC/DESC]

If we want to retrieve records with sorting names of employees ascending order(default).

MATCH (e:emp) RETURN e ORDER BY e.name;
Enter fullscreen mode Exit fullscreen mode

For descending,

MATCH (e:emp) RETURN e ORDER BY e.designation DESC;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)