mirror of
https://gitlab.com/little-lines/backend.git
synced 2025-07-07 13:51:05 +00:00
get by id
This commit is contained in:
parent
0feed90cfc
commit
b28f6d5430
5 changed files with 80 additions and 41 deletions
|
@ -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)
|
||||
|
||||
//ตัวอย่างข้อมูล
|
||||
// {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue