| Current Path : /home/deltalab/PMS/partner-manager-backend/models/mongoose/ |
| Current File : //home/deltalab/PMS/partner-manager-backend/models/mongoose/recommendation.js |
const mongoose = require('mongoose');
const { Schema } = mongoose;
const ProductPermutationSchema = new Schema(
{
product_permutation: [Number],
explanation: String,
},
{
_id: false,
versionKey: false,
},
);
const RecommendationSchema = new Schema(
{
product_id: { type: Schema.Types.ObjectId, ref: 'Product' },
all_linkedProducts: [{ type: Schema.Types.ObjectId, ref: 'Product' }],
linkedProducts_permutations: Schema.Types.Mixed,
},
{
collection: 'productbasedrecommendations',
timestamps: true,
versionKey: false,
},
);
const userBasedRecommendationModel = mongoose.model('UserBasedRecommendation', RecommendationSchema);
module.exports = {
userBasedRecommendationModel,
};