import{Schema as e}from"mongoose";import{commonModeSchemaOptions as t,addIdVirtualFields as i}from"@common-stack/store-mongo";const n=new e({name:{type:e.Types.String,required:!0,maxlength:150},state:{type:e.Types.String,ref:"states",required:!0,onDelete:"cascade"},_id:{type:e.Types.String,required:!0,unique:!0},location:{type:{type:e.Types.String,default:"Point",enum:["Point"]},coordinates:{type:[e.Types.Number],required:!0}}},{...t,_id:!1});n.index({name:1,state:1},{unique:!0}),n.index({_id:1,state:1},{unique:!0}),n.index({location:"2dsphere"}),i(n);const o=e=>e.model("cities",n);export{o as CityModelFunc};