import mongoose, {Schema, PopulatedDoc, Document, Model} from "mongoose"; export enum Color { "orange" = "orange", "yellow" = "yellow", "green" = "green", "turquoise" = "turquoise", "cyan" = "cyan", "blue" = "blue", "purple" = "purple", "red" = "red", "pink" = "pink" } export interface ISidebarItem { color: Color url: string linkTitle: string index: number; } const SISchema = new mongoose.Schema({ color: { type: String, enum: Object.values(Color) }, url: { type: String }, linkTitle: { type: String }, index: { type: Number } }) export const SidebarItem: Model = /* mongoose.models.SidebarItem || */ mongoose.model("SidebarItem", SISchema, "sidebar")