hi
I have a question.
The obstacle object key is uuid.
The following function is a function that can update the obstacle only one at a time.
Obstacle: Obstacle to obstacle_list: Array I want a function that can update only changed values at once.
static update(user_uuid: string, obstacle: Obstacle): Promise<any> {
return new Promise<any>((resolve: () => void, reject: (error_code: error.ERROR_CODE) => void) => {
var query: string = util.format("update `game` use keys '%s_HOME' set obstacle_list[idx] = %s for idx : o in obstacle_list when o.uuid = '%s' end",
user_uuid, JSON.stringify(obstacle), obstacle.uuid);
couch_helper.query("game", query)
.then((rows: Array<any>) => {
resolve();
return;
})
.catch((error_code: error.ERROR_CODE) => {
return reject(error_code);
});
});
}
static update(user_uuid: string, obstacle_list: Array): Promise {
?? query
}