如何使用 ionic4 存储更新嵌套数组

How can I update a nested array with ionic4 storage

使用

openSavedForm() {
  this.storage.get('test').then((val) => {
    this.auditResults = JSON.parse(val);
    this.audit = this.auditResults
    this.auditOne = this.auditResults.siteVehicle; 
    console.log('pull all', this.audit);     
  });
}

我可以在 sqlite 中查看我的键值对存储项。这是 console.log

的照片

是否可以只更新 siteVehicle 数组

async saveFormUpdates() {
  this.newAudit =this.auditOne;
  await this.storage.set( 'test', JSON.stringify(this.newAudit));
  console.log ("storage", this.newAudit);
} 

不删除所有其他数组?

我的异步 saveFormUpdates() 是错误的。结果只是保存 this.audit 而不是 this.auditOne 完成了所有操作,我没有进一步输入。

async saveFormUpdates() {
 this.newAudit = this.audit;
 await this.storage.set( 'test', JSON.stringify(this.newAudit));
 console.log ("storage", this.newAudit);
}