We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06e91d0 commit 9f810c2Copy full SHA for 9f810c2
doctests/string-set-get-example.js
@@ -0,0 +1,27 @@
1
+// EXAMPLE: set_and_get
2
+// REMOVE_START
3
+import assert from "node:assert";
4
+// REMOVE_END
5
+
6
+// HIDE_START
7
+import { createClient } from 'redis';
8
9
+const client = createClient();
10
11
+client.on('error', err => console.log('Redis Client Error', err));
12
13
+await client.connect().catch(console.error);
14
15
+// HIDE_END
16
+await client.set('bike:1', 'Process 134');
17
+const value = await client.get('bike:1');
18
+console.log(value);
19
+// returns 'Process 134'
20
+//REMOVE_START
21
+assert.equal(value, 'Process 134');
22
+await client.del('bike:1');
23
+//REMOVE_END
24
25
26
+await client.quit();
27
0 commit comments