我在使用SQLite数据库的项目中使用ionic 3。除此代码的UPDATE之外,我已经执行了所有其他CRUD操作
this.sqlite.create({
name: 'nearbye.db',
location: 'default'
}).then((db: SQLiteObject)=>{
db.executeSql('UPDATE chats SET read=? WHERE read=?', ['time','checked']).then(res =>{
console.log(JSON.stringify(res));
}).catch(e => alert(JSON.stringify(e)))
}).catch(e => alert(JSON.stringify(e)));
我在db中的示例数据是
{"id":35,"textFrom":"xxxx","textTo":"xxxx","message":"15","time":1540823439874,"read":"time","image":"","friend":"xxxx"},
{"id":36,"textFrom":"xxxx","textTo":"xxxx","message":"16","time":1540823441705,"read":"time","image":"","friend":"xxxx"}
查询返回{"rows":{"length":0},"rowsAffected":0}
尽管我有符合条件的行。请帮忙!