Skip to content

Commit 75183ce

Browse files
Merge pull request #65 from RedisInsight/main
Updating sample data for tutorials
2 parents c95500f + 024e539 commit 75183ce

File tree

2 files changed

+196
-196
lines changed

2 files changed

+196
-196
lines changed

src/uc/intro.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can store your bike inventory using the JSON data structure, where bikes hav
1313

1414
```redis:[run_confirmation=true] Add a bike as JSON
1515
// Add a bike as JSON
16-
JSON.SET bicycle:2048 $ '{
16+
JSON.SET sample_bicycle:2048 $ '{
1717
"model": "Ranger",
1818
"brand": "TrailBlazer",
1919
"price": 450,
@@ -35,9 +35,9 @@ In Redis, you can easily index these attributes and perform complex queries effi
3535

3636
```redis:[run_confirmation=true] Create a bike index
3737
// Create a secondary index of your bike data
38-
FT.CREATE idx:bicycle
38+
FT.CREATE idx:smpl_bicycle
3939
ON JSON
40-
PREFIX 1 bicycle:
40+
PREFIX 1 sample_bicycle:
4141
SCHEMA
4242
$.brand AS brand TEXT
4343
$.model AS model TEXT
@@ -54,7 +54,7 @@ You can then easily match a user to their preferred type of bike within a reques
5454

5555
```redis:[run_confirmation=true] Search for a match
5656
// Match leisure bikes within a price of 200 and 300
57-
FT.SEARCH idx:bicycle "@type:{mountain} @price:[400 450]" RETURN 4 brand model type price
57+
FT.SEARCH idx:smpl_bicycle "@type:{mountain} @price:[400 450]" RETURN 4 brand model type price
5858
```
5959

6060
### Session store
@@ -63,15 +63,15 @@ Redis shines as a session store, offering speed and scalability for web applicat
6363

6464
```redis:[run_confirmation=true] Create a session hash with expiration
6565
// Store new session
66-
HSET session:074529275 user_id 7254 username gabe_jones email gabe@example.com last_activity "2024-06-01 10:24:00"
66+
HSET sample_session:074529275 user_id 7254 username gabe_jones email gabe@example.com last_activity "2024-06-01 10:24:00"
6767
6868
// Set an expiration time for the new session entry
69-
EXPIRE session:074529275 7344000
69+
EXPIRE sample_session:074529275 7344000
7070
```
7171

7272
```redis:[run_confirmation=true] Retrieve a session
7373
// Retrieve an existing session
74-
HGETALL session:074529275
74+
HGETALL sample_session:074529275
7575
```
7676

7777
### Job queue
@@ -81,19 +81,19 @@ In many applications, tasks need to be processed asynchronously, such as maintai
8181

8282
```redis:[run_confirmation=true] Create a job ticket
8383
// Create a new job as a Hash
84-
HSET jobQueue:ticket:199 id 199 user_id 723 description "Unable to access console" priority "High" created_at "2024-04-20T12:00:00Z"
84+
HSET sample_jobQueue:ticket:199 id 199 user_id 723 description "Unable to access console" priority "High" created_at "2024-04-20T12:00:00Z"
8585
```
8686
```redis:[run_confirmation=true] Enqueue job
8787
// Enqueue the new job to the waiting list
88-
LPUSH jobQueue:waitingList jobQueue:ticket:199
88+
LPUSH sample_jobQueue:waitingList jobQueue:ticket:199
8989
```
9090
```redis:[run_confirmation=true] Show all jobs
9191
// Show the full list of jobs
92-
LRANGE jobQueue:waitingList 0 -1
92+
LRANGE sample_jobQueue:waitingList 0 -1
9393
```
9494
```redis:[run_confirmation=true] Dequeue a job
9595
// Dequeue a job from the list
96-
RPOP jobQueue:waitingList
96+
RPOP sample_jobQueue:waitingList
9797
```
9898

9999
### Leaderboard
@@ -102,10 +102,10 @@ RPOP jobQueue:waitingList
102102

103103
```redis:[run_confirmation=true] Create a leaderboard score
104104
// Add a new score to leaderboard
105-
ZADD leaderboard:tetris 670000 "user100"
105+
ZADD sample_leaderboard:tetris 670000 "user100"
106106
```
107107

108108
```redis:[run_confirmation=true] Get users with scores
109109
// Get the top 5 users on the leaderboard, with scores
110-
ZRANGE leaderboard:tetris 0 4 REV WITHSCORES
110+
ZRANGE sample_leaderboard:tetris 0 4 REV WITHSCORES
111111
```

0 commit comments

Comments
 (0)