请问update更新字段值如何使用表达式
hangge666 opened this issue · 3 comments
hangge666 commented
jerryhu commented
代码示例:
await this.app.mysql.update('post_comment', { id: commentId, replies: new Literal('(replies+1)') });
const updateOptions = [];
updateOptions.push({ id: postId, replies: new Literal(`(replies+${replyCount})`) });
await this.app.mysql.updateRows('post_comment', updateOptions);
hangge666 commented
代码示例:
await this.app.mysql.update('post_comment', { id: commentId, replies: new Literal('(replies+1)') });const updateOptions = []; updateOptions.push({ id: postId, replies: new Literal(`(replies+${replyCount})`) }); await this.app.mysql.updateRows('post_comment', updateOptions);
学到了 , 不过您是在哪里看到的呢? 总之谢谢您了
puzzle9 commented
代码示例:
await this.app.mysql.update('post_comment', { id: commentId, replies: new Literal('(replies+1)') });const updateOptions = []; updateOptions.push({ id: postId, replies: new Literal(`(replies+${replyCount})`) }); await this.app.mysql.updateRows('post_comment', updateOptions);学到了 , 不过您是在哪里看到的呢? 总之谢谢您了