Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mongoose = require('mongoose');
- const Schema = mongoose.Schema;
- const restaurantSchema = new Schema({
- name: {
- type: String,
- required: true
- },
- type: {
- type: [String],
- required: true
- },
- hour: {
- type: {
- start: {
- type: String,
- required: true
- },
- end: {
- type: String,
- required: true
- }
- },
- required: true
- },
- menu: {
- type: [
- {
- name: {
- type: String,
- required: true
- },
- unit_price: {
- type: Number,
- required: true
- }
- }
- ],
- required: true
- },
- images: [String],
- features: {
- wifi: Boolean,
- delivery: Boolean,
- ac: Boolean,
- smoking_zone: Boolean,
- reservation: Boolean,
- parking: Boolean
- },
- social: {
- facebook: String,
- instagram: String,
- twitter: String,
- contact: String
- },
- offers: {
- type: [
- {
- title: {
- type: String,
- required: true
- },
- image: String,
- }
- ]
- },
- location: {
- road_no: Number,
- house_no: Number,
- area: {
- type: String,
- required: true
- },
- district: {
- type: String,
- required: true
- }
- }
- });
- module.exports = mongoose.Model('Restaurant', restaurantSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement