Darren Cassidy
Posts: 0
Joined: Mon Aug 11, 2014 2:10 pm

Updating an array in the database

I want to update an array in my database with a users ID, for testing purposes i'm trying to just push a string to the array.

When i do it in the tester with,
{"__op":"AddUnique","objects":["user"]}
%% this works perfectly.

When i do it inside of the datasource,
return '{"__op":"AddUnique","objects":["user"]}';
%% this does not work

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Updating an array in the database

Hi Darren,

Are there any console errors?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Updating an array in the database

Hi Darren,

Please click the request itself, a Network browser tab will be opened. Could you please post screenshots of request and server response?

Darren Cassidy
Posts: 0
Joined: Mon Aug 11, 2014 2:10 pm

Updating an array in the database

fixed it!
return {"__op":"AddUnique","objects":[value]};

Darren Cassidy
Posts: 0
Joined: Mon Aug 11, 2014 2:10 pm

Updating an array in the database

So now when a user votes on a post, their ID is added to an array for the respective post.

What would the 'where' clause look like for the Database_Posts_list_service'. The column name of the array in Posts is 'voters'..

thanks!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Updating an array in the database

Hi Darren,

Thanks for your update.

Give us to know if you will have some problem with this issue.

Regards.

Return to “Issues”