Cloud function updating count for record id on Skygear Cloud


Hello, i have a record like :
Pahtologie : *title, *content,*like, *comment
Comment is referencer at the table pathologie, but my concern is to increment the like of pathologie_id every time we comment in the table with skygear function. Thanks

skygearCloud.afterSave('comment', function(record, original, pool, options) {
	if (!original) {
		pool.query(`UPDATE pathologie SET like = like + 1, _updated_at = CURRENT_TIMESTAMP WHERE '_id' = '${record.pathologie_id}'`, function(err, result) {
			if (err) {

}, {
    async: false

Can i do like this ?


Yes. You can do it via SQL or SkyRecord Query.


I can’t deploy because of dashboard


The status icon was down but it should not affect production nodes. It should have been back online now.