如何更好地将一个文档保存在一个文档中,保存所有文档或保存objectID并找到我需要的所有objectsID?例如。
> Collection A { "_id": ObjectId("4f67da1538fc5d7347000000"),
> Name:'name', "products": {
> "0": {
> "barcode": "25001",
> "name": "GoldClass",
> "Price": "12.00",
> "CashBack": "2.00"
> },
> "1": {
> "barcode": "25002",
> "name": "Weekday",
> "Price": "12.00",
> "CashBack": "2.00"
> },
> "2": {
> "barcode": "25003",
> "name": "Weekend",
> "Price": "24.00",
> "CashBack": "4.00"
> } }}
保存我要保存的产品的ObjectID,如果需要显示产品进行查询以逐一查找这些产品?