0

我正在使用 NeDB 作为数据库制作电子应用程序。
文档结构如下:

For a machine (<= 150 machines), I need to add a comment for the
machine regularly.

对于这种情况,哪种文档结构会更好

  1. 为机器制作 1 个文档,并将每个条目推送到文档中的数组字段。

    {
     machine_no : string,  
     date: [Date],  
     comment: [string]  
    }
    
  2. 为每个条目制作一个包含 machine_no 的新文档。

    {
     machine_no : string,  
     date: Date,  
     comment: string  
    }  
    

我想要插入、查看和更新​​现有数据的操作。
对于这种情况,哪种文档结构会更好,为什么?

4

0 回答 0