All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis_lua.getByIndex.lua Maven / Gradle / Ivy

The newest version!
-- 根据聚集索引取得

local table = KEYS[1];
local table_index = KEYS[2];

local objs = {};
-- 1.先根据索引取得主键列表
local primaryKeys = redis.call('smembers', table_index);
if (primaryKeys) then
    -- 2. 根据主键取得对象
    for i, v in ipairs(primaryKeys) do
        objs[i] = redis.call('hget', table, v);
    end
    return objs;
else
    return objs;
end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy