review.js 347 B

12345678910111213
  1. const mongoose = require('mongoose')
  2. const Schema = mongoose.Schema
  3. const ReviewSchema = new Schema({
  4. headline: String,
  5. body: String,
  6. rating: Number,
  7. photo: String,
  8. productID: { type:Schema.Types.ObjectId, ref: 'Product' },
  9. user: { type:Schema.Types.ObjectId, ref: 'User' },
  10. })
  11. module.exports = mongoose.model('Review', ReviewSchema)