Garyson
Posts: 0
Joined: Fri Mar 14, 2014 5:59 pm

A problem of updating data using DatabaseUser

Hello! I'm trying to update an array to my USERS collection in database but meet some problem! I follow this tutorial http://docs.appery.io/documentation/b... my service's server code is here:

____________________________________________________

var dbId = "53157a73e4b0fe98ca23a847";
var friend_id = request.get("friend_id");
var id = request.get("_id");
var username=request.get("username");
var password=request.get("password");

var token = DatabaseUser.login(dbId, username, password).sessionToken;
//var token = request.get("sessionToken");
var updated = DatabaseUser.update(dbId, id, {
"friend": {"__op":"AddUnique","objects":[friend_id]}
}, token);

______________________________________________________________________

response.success();

This code can be tested successfully in the SERVER CODE ,but when I invoke this service in my app, it seems that the service can't stop(or maybe can't get a correct response),because the SUCCESS EVENT of this service never be triggered but the data I want to update have already been add to the database....
,
what's worse ,I've got another 2 service like this ......Please help!!T T
Image

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

A problem of updating data using DatabaseUser

Hello,

Please check, may be an error event for service is triggered. Are there any errors in console?

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

A problem of updating data using DatabaseUser

Hi,

Did you find any errors?

Garyson
Posts: 0
Joined: Fri Mar 14, 2014 5:59 pm

A problem of updating data using DatabaseUser

It seems that you are right, I check my event and request parm then solve this problem~~

Return to “Issues”