1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
This commit is contained in:
Leibale
2023-10-02 12:03:04 -04:00
parent d62e332470
commit 225efc0b43
19 changed files with 386 additions and 422 deletions

View File

@@ -4,6 +4,8 @@ import FUNCTION_LOAD from './FUNCTION_LOAD';
import { RedisClientType } from '../client';
import { NumberReply, RedisFunctions, RedisModules, RedisScripts, RespVersions } from '../RESP/types';
export const MATH_FUNCTION = {
name: 'math',
engine: 'LUA',
@@ -11,10 +13,10 @@ export const MATH_FUNCTION = {
`#!LUA name=math
redis.register_function {
function_name = "square",
callback = function(keys, args) {
callback = function(keys, args)
local number = redis.call('GET', keys[1])
return number * number
},
end,
flags = { "no-writes" }
}`,
library: {