restaurant.model.js 518 B

123456789101112131415161718192021222324252627
  1. const mongoose = require('mongoose');
  2. const RestaurantSchema = new mongoose.Schema(
  3. {
  4. name: {
  5. type: String,
  6. },
  7. index: {
  8. type: Number,
  9. },
  10. adress: {
  11. type: String,
  12. },
  13. latitude: {
  14. type: Number
  15. },
  16. longitude: {
  17. type: Number
  18. },
  19. }
  20. );
  21. exports.RestaurantSchema = RestaurantSchema;
  22. Restaurant = mongoose.model('Restaurant', RestaurantSchema );
  23. exports.Restaurant = Restaurant;