Fetching whole table from parse

Hi,

I am using parse to save the data. Now I know how can I get record one by one. But What I want to do is fetch whole table from parse and store in app. Then I will be able to use stored values. I need a little help about how to fetch whole table from parse and save in lua table.

Thanks

I would like to add to my question. When fetching a specific record from parse I can store it in array like this

for k,v in pairs(response) do LocalAccount[k] = v end

Now when I call the whole table from network.request, I can see the results in response object in console. But a little unsure how can I save this in lua table. Any help?

You have to provide a bit more info. What you are doing in your code is just copying a lua table to another lua table which i don’t realy see why as you can assign it directly to keep a reference to it: LocalAccount = response.

If your whole table response is a lua table aswell then I imagine it is a table holding records as lua tables like you get in a single record response. If you are parsing the response in to a lua table then you have to include that code in your question. You can keep a reference to it the same way, you just have to read it differently. For example reading the ID field from the second record would look like

local LocalAccounts = response

local id = LocalAccounts[2][“ID”]

Good luck.

I would like to add to my question. When fetching a specific record from parse I can store it in array like this

for k,v in pairs(response) do LocalAccount[k] = v end

Now when I call the whole table from network.request, I can see the results in response object in console. But a little unsure how can I save this in lua table. Any help?

You have to provide a bit more info. What you are doing in your code is just copying a lua table to another lua table which i don’t realy see why as you can assign it directly to keep a reference to it: LocalAccount = response.

If your whole table response is a lua table aswell then I imagine it is a table holding records as lua tables like you get in a single record response. If you are parsing the response in to a lua table then you have to include that code in your question. You can keep a reference to it the same way, you just have to read it differently. For example reading the ID field from the second record would look like

local LocalAccounts = response

local id = LocalAccounts[2][“ID”]

Good luck.