const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const locationSchema = new Schema({
    userId: {
        type: Schema.Types.ObjectId,
        ref: "User",
        required: true
    },
    location:{
        type:{
            type: String,
            enum: ["Point"],
        }, 
        coordinates:{
            type: [Number]
        },
        locationName: {
            type: String
        },
        title:{
            type: String
        },
        isSelected: {
            type: Boolean,
            default: true
        }
    },
});

const locationModel = mongoose.model("Location", locationSchema);
module.exports = locationModel;