Skip to content

Instantly share code, notes, and snippets.

@tridungle
Forked from kayslay/hotelModel.js
Created May 11, 2021 08:27
Show Gist options
  • Save tridungle/bd230f89fb248bea99deab56647c3c2f to your computer and use it in GitHub Desktop.
Save tridungle/bd230f89fb248bea99deab56647c3c2f to your computer and use it in GitHub Desktop.
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const hotelSchema = new Schema({
hotel_name: {type: String},
location: {type: String},
city: {type: String},
state: {type: String},
present_price: {type: String},
features: {type: [String]},
hotelsNg_link: {type: String},
});
hotelSchema.index({hotel_name: 1, city: 1, state: 1}, {unique: true, dropDups: true});
module.exports = mongoose.model("hotel", hotelSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment