Join set with multiple keys
snippet in lua

Join set with multiple keys

user5795

 items = {
     "121",
     "122",
     "123"
 }

 keys = {
     ["item:121"]: "value1",
     ["item:122"]: "value2",
     ["item:123"]: "value3"
 }

 -- correlate the two tables
 result = {}
 for i,item in pairs(items) do
     result[item] = keys["item:" .. item]
 end

 -- result:
 result = {
     ["121"] = "value1",
     ["122"] = "value2",
     ["123"] = "value3"
 }