123456789101112131415161718192021222324252627282930313233343536373839 |
- const mongoose = require('mongoose');
- // Create the MovieSchema.
- var reviewSchema = new mongoose.Schema({
- userName: {
- type: String
- },
- date: {
- type: Date,
- required: true,
- default: Date.now
- },
- url: {
- type: String,
- required: true
- },
- score: {
- type: Number,
- required: true
- },
- title: {
- type: String
- },
- text: {
- type: String
- },
- sentiment: {
- type: mongoose.Schema.Types.Mixed
- },
- reviewId: {
- type: String,
- required: true,
- unique: true
- },
- app: { type: mongoose.Schema.Types.ObjectId, ref: 'app' }
- });
- // Export the model.
- module.exports = mongoose.model('review', reviewSchema);
|