【发布时间】:2021-04-19 14:20:48
【问题描述】:
我对 noSQL 数据库很陌生,并且遇到了一个我不知道如何解决的问题。 我有两个集合服务和产品。
Service 的架构如下:
name: { type: String, required: 'Enter name' },
price: { type: Number, required: 'Enter price' },
description: { type: String},
duration: { type: String, required: 'Enter duration' },
products: {type: [Product]}
Product 的架构如下:
name: { type: String, required: 'Enter name' },
description: { type: String},
qty: { type: Number, required: 'Enter quantity' },
unitsOfMeasure: { type: String, default: UOM.Piece},
qtyPerService: {type: Number}
现在您可以看到 Service 包含一组产品。当我更新我的产品集合中的某些产品时,它不会在包含该确切产品的服务中更新。我知道这不是因为服务产品没有链接到 Products 集合中的源文档,但我不知道如何实现这一点。
感谢任何提示或想法。 谢谢
【问题讨论】: