I am trying to use nk.storage_write(x) in lua rpc code
When i define the table (x) that i want to use with nk.storage_write like this:
local x = {
{ collection = “save”, key = “save1”, user_id = user_id, value = {} }
}
Every thing workes fine this way
But my function needs table x to be created based on some parameters in the function using
table. Insert for example like this:
local x = {}
For i, v in ipairs y do
Table.insert(x, { collection = “save”, key = “save1”, user_id = user_id, value = v }
})
End
But when i use table.insert to add to table x and use it in nk.storage_write i got an error in terminal that x is not a table
Any idea on how i can make it work?
Thanks in advance