get by id

This commit is contained in:
p11037 2023-11-22 16:45:06 +07:00
parent 0feed90cfc
commit b28f6d5430
5 changed files with 80 additions and 41 deletions

View file

@ -1,27 +1,31 @@
const { default: mongoose } = require("mongoose")
const favSchema = new mongoose.Schema({
user_id : {type:String,required: true},
place_name : String,
const favoriteSchema = new mongoose.Schema({
user_id: {
type: String,
required: true
},
place_name: String,
location: {
type: {
type: String,
enum: ['Point'],
default: 'Point'
required: true
},
coordinates: {
type: [Number],
required: true
}
},
wheelchair_access : String,
highway_type : String,
updated_at : {type:Date, default:Date.now}
})
wheelchair_access: String,
highway_type: String,
updated_at: { type: Date, default: Date.now }
});
module.exports = mongoose.model('favorites',favSchema)
module.exports = mongoose.model('favorites',favoriteSchema)
//ตัวอย่างข้อมูล
// {