mirror of
https://gitlab.com/little-lines/backend.git
synced 2025-07-07 14:11:04 +00:00
favApi
This commit is contained in:
parent
05c8212b75
commit
0d364fa4cc
5 changed files with 116 additions and 29 deletions
36
models/favorites.js
Normal file
36
models/favorites.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
const { default: mongoose } = require("mongoose")
|
||||
|
||||
const favSchema = new mongoose.Schema({
|
||||
user_id : {type:String,required: true},
|
||||
place_name : String,
|
||||
location: {
|
||||
type: {
|
||||
type: String,
|
||||
enum: ['Point'],
|
||||
default: 'Point'
|
||||
},
|
||||
coordinates: {
|
||||
type: [Number],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
wheelchair_access : String,
|
||||
highway_type : String,
|
||||
updated_at : {type:Date, default:Date.now}
|
||||
})
|
||||
|
||||
|
||||
|
||||
module.exports = mongoose.model('favorites',favSchema)
|
||||
|
||||
//ตัวอย่างข้อมูล
|
||||
// {
|
||||
// "user_id": "651310bdb59abf1a593e2368",
|
||||
// "place_name": "Nonthaburi",
|
||||
// "location": {
|
||||
// "type": "Point",
|
||||
// "coordinates": [100.5212, 13.8593] // ลำดับตำแหน่งแรกเป็นลองจิจูดและตำแหน่งที่สองเป็นละติจูด
|
||||
// },
|
||||
// "wheelchair_access": "accessible",
|
||||
// "highway_type": "expressway"
|
||||
// }
|
Loading…
Add table
Add a link
Reference in a new issue