在node对mysql的查询中,查询的返回结果中。
-
select * from table返回结果是数组
(Array)类型。结构是数组中包含对象。[{},{}] -
insert返回结果是Object类型,结果如下所示insert into table () values (){ fieldCount: 0, affectedRows: 1, //影响行数 insertId: 481, //ID serverStatus: 2, //服务器状态 warningCount: 0, //警告 message: '', //信息 protocol41: true, //协议 changedRows: 0 //改变的行数 } -
update返回的结果类型为Objectupdate table set xx = xx where xx = xx返回结果:
{ fieldCount: 0, affectedRows: 1, insertId: 0, serverStatus: 2, warningCount: 0, message: '(Rows matched: 1 Changed: 1 Warnings: 0', protocol41: true, changedRows: 1 } -
delete返回的结果类型为Objectdelete from table where xx = xx返回结果:
Object{ fieldCount: 0, affectedRows: 1, insertId: 0, serverStatus: 2, warningCount: 0, message: '(Rows matched: 1 Changed: 1 Warnings: 0', protocol41: true, changedRows: 1 }