We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f3d0f3 commit cd8fa4eCopy full SHA for cd8fa4e
doctests/cmd-set-and-get.js
@@ -0,0 +1,26 @@
1
+// EXAMPLE: set_and_get
2
+// REMOVE_START
3
+import assert from "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();
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
+//REMOVE_END
23
24
25
+await client.quit();
26
0 commit comments