Skip to content

Instantly share code, notes, and snippets.

@kayslay
Created June 28, 2020 22:07
Show Gist options
  • Save kayslay/b1eda03fe3d8e17508becda769cd74cc to your computer and use it in GitHub Desktop.
Save kayslay/b1eda03fe3d8e17508becda769cd74cc 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