mongoose与其他数据的多对多关系

产品架构:

var ProductSchema = new Schema({ productName: {type: String, required: true}, }); 

客户端模式:

 var ClientSchema = new Schema({ clientName: {type: String, required: true}, products: [{ type : mongoose.Schema.ObjectId, ref : 'Product'}], }); 

我怎样才能添加额外的领域的关系? 例如添加字段数量

 var ClientSchema = new Schema({ clientName: {type: String, required: true}, products: [{ type : mongoose.Schema.ObjectId, ref : 'Product', quantity: Number}], }); 

       

网上收集的解决方案 "mongoose与其他数据的多对多关系"