Initial Version
This commit is contained in:
20
server/models/Review.js
Normal file
20
server/models/Review.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
const reviewSchema = mongoose.Schema({
|
||||
user: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'user'
|
||||
},
|
||||
product: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'product'
|
||||
},
|
||||
comment: {
|
||||
type: String
|
||||
},
|
||||
star: {
|
||||
type: Number,
|
||||
max:5
|
||||
}
|
||||
}, { timestamps: true });
|
||||
module.exports = mongoose.model('reviews', reviewSchema);
|
||||
Reference in New Issue
Block a user