Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. // import mongoose
  2. const mongoose = require('mongoose')
  3. const Schema = mongoose.Schema
  4.  
  5. // create Schema instance
  6. const RestaurantSchema = new Schema({
  7. name: {
  8. type: String,
  9. required: true
  10. },
  11. name_en: {
  12. type: String,
  13. required: true
  14. },
  15. category: {
  16. type: String,
  17. required: true
  18. },
  19. image: {
  20. type: String,
  21. required: true
  22. },
  23. location: {
  24. type: String,
  25. required: true
  26. },
  27. phone: {
  28. type: String,
  29. required: true
  30. },
  31. google_map: {
  32. type: String,
  33. required: true
  34. },
  35. rating: {
  36. type: Number,
  37. required: true
  38. },
  39. description: {
  40. type: String,
  41. required: true
  42. }
  43. })
  44.  
  45. // exports RestaurantSchema as Restaurant
  46. module.exports = mongoose.model('Restaurant', RestaurantSchema)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement