You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tf/load.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
When creating a new library you add the code to Redis using the `TFUNCTION LOAD` command.
2
2
The code needs to contain a preamble that defines which engine is used, the name of the library, and the minimum API version to use.
3
3
4
-
```redis Upload library
4
+
```redis:[run_confirmation=true] Upload library
5
5
TFUNCTION LOAD
6
6
"#!js name=myFirstLibrary api_version=1.0\n
7
7
redis.registerFunction('hello', ()=>{
@@ -17,7 +17,7 @@ TFUNCTION LIST
17
17
18
18
Execute the function that was uploaded.
19
19
20
-
```redis Execute function
20
+
```redis:[run_confirmation=true] Execute function
21
21
TFCALL // TFCALL for running sync functions, TFCALLASYNC for async
22
22
myFirstLibrary.hello // the name of the library.function
23
23
0 // the number of keys provided as arguments
@@ -27,7 +27,7 @@ You can pass arguments to your functions when executing them. In the following e
27
27
28
28
To update the library, add the `REPLACE` option to the `LOAD` command.
29
29
30
-
```redis Replace the library
30
+
```redis:[run_confirmation=true] Replace the library
31
31
TFUNCTION LOAD REPLACE // The replace flag is added when the library already exist
32
32
"#!js name=myFirstLibrary api_version=1.0\n
33
33
redis.registerFunction('hello', (client, arg)=>{
@@ -37,7 +37,7 @@ TFUNCTION LOAD REPLACE // The replace flag is added when the library already exi
37
37
38
38
Now run the command with an additional argument. It's important to understand that `TFCALL` takes both keys and arguments. Because arguments follow keys, the number of keys passed is still `0` in this example.
39
39
40
-
```redis Execute function
40
+
```redis:[run_confirmation=true] Execute function
41
41
TFCALL
42
42
myFirstLibrary.hello
43
43
0
@@ -46,6 +46,6 @@ TFCALL
46
46
47
47
The library can be deleted with the following command.
0 commit comments