Skip to content

Commit 6362ccf

Browse files
committed
Issue #28: Created a file in docs with basic valkey commands
Signed-off-by: bota <[email protected]>
1 parent 1532224 commit 6362ccf

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

docs/book/v1/valkey.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Valkey usage
2+
3+
Valkey is an open source (BSD) high-performance key/value datastore that supports a variety of workloads such as caching, message queues, and can act as a primary database.
4+
5+
The following commands can be run in the CLI to interact with Valkey. To enter CLI run:
6+
7+
`valkey-cli`
8+
9+
### Utility Commands
10+
11+
List all keys matching a pattern.
12+
13+
`KEYS *`
14+
15+
Get server information and statistics.
16+
17+
`INFO`
18+
19+
Check if the server is running.
20+
21+
`PING`
22+
23+
Delete all keys in all databases
24+
25+
`FLUSHALL`
26+
27+
Check data type stored at a specific key (Possible types: string, list, set, zset, hash, stream)
28+
29+
`TYPE keyName`
30+
31+
### Key-Value Operations
32+
33+
Set a string key to a value.
34+
35+
`SET keyName "keyValue"`
36+
37+
Get the value of a key.
38+
39+
`GET keyName`
40+
41+
Delete one or more keys.
42+
43+
`DEL keyName1 keyName2`
44+
45+
### Stream Commands
46+
47+
Read entries from a stream oldest to newest (revers '-' and '+' to reverse order).
48+
49+
`XRANGE streamName - +`
50+
51+
Delete stream
52+
53+
`DEL streamName`
54+
55+
Remove all stream entries and keep stream key
56+
57+
`XTRIM streamName MAXLEN 0`
58+
59+
Delete specific entry
60+
61+
`XDEL streamName <entryId>`

0 commit comments

Comments
 (0)