Files
menui_backend/models/restaurant.js
Jonasz Bigda 2abec5017f New project structure
New folder structure
Changed to type:module
Moved routes to separate files
2020-07-17 22:07:55 +02:00

28 lines
495 B
JavaScript

import mongoose from "mongoose";
const restaurantSchema = mongoose.Schema({
_id: mongoose.Types.ObjectId,
name: {
type: String,
maxlength: 128,
required: true,
},
city: {
type: String,
maxlength: 128,
required: true,
},
imgUrl: {
type: String,
required: true,
},
workingHours: {
type: String,
required: true,
},
hidden: Boolean,
dishes: [mongoose.Types.ObjectId],
});
export default mongoose.model("Restaurant", restaurantSchema);