mongoDB架构更改会导致旧用户出错?

时间:2016-04-18 14:37:29

标签: node.js mongodb mongoose schema

我的服务器中有一个架构,如下所示:

deliveryAddress :  {
        city: String,
        state: String,
        country: String,
        zipcode: String
      }

但由于未来的增强功能,我们需要在此deliveryAddress集合对象中添加电话号码。但是已经注册的用户将面临问题,我该如何解决这个问题。

架构将来应该如下所示:

deliveryAddress :  {
        city: String,
        state: String,
        country: String,
        zipcode: String,
        phoneNumber:String
      }

0 个答案:

没有答案