Page 1 of 1

How to read Array from database?

Posted: Mon Aug 22, 2016 7:43 am
by Nicklas

Hi!
In my DB i have a Column that is an Array.
Image

How do i get/list up those?

I've tried with the link bellow but thats more for listing up rows, not one column (Array).
https://docs.appery.io/docs/database-...


How to read Array from database?

Posted: Mon Aug 22, 2016 8:18 am
by Serhii Kulibaba

Hello Nicklas,

You can read an array column at the same way as you read all other columns.
Could you clarify what you have tried and what exactly does not work?


How to read Array from database?

Posted: Mon Aug 22, 2016 8:30 am
by Nicklas

Ok, we can use the "Channels" in the device-collection as an example.
What I need, is to change f.eks. one of the channels.

Lets say that the channels is [1,2,6] and i want to change it to [1,3,6].


How to read Array from database?

Posted: Mon Aug 22, 2016 11:22 am
by Serhii Kulibaba

Please look at this example how to update a collection "Devices": https://docs.appery.io/reference#push...


How to read Array from database?

Posted: Tue Aug 23, 2016 8:36 am
by Nicklas

I have seen that one but I dont understand how to set up the Body in the request of the service. Is it like this?
Image


How to read Array from database?

Posted: Tue Aug 23, 2016 8:51 am
by Nicklas

I found this one now. I will look into that one. Thank you so far :)
https://docs.appery.io/reference#data...


How to read Array from database?

Posted: Tue Aug 23, 2016 10:49 am
by Nicklas

I have tried for 2 hours now to create a mapping to send array to the DB, but I cant make it work. Could you make an example of mapping to me?


How to read Array from database?

Posted: Thu Aug 25, 2016 7:49 pm
by Evgene Karachevtsev

Nicklas,

Unfortunately the creation of such a sample would require additional development time, but I hope this link could be useful for you:
https://getsatisfaction.com/apperyio/...