import mongoose, { 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 | string; url: string; linkTitle: string; index: number; } const SISchema = new mongoose.Schema({ color: { type: String, }, url: { type: String, }, linkTitle: { type: String, }, index: { type: Number, }, }); export const SidebarItem: Model = mongoose.models.SidebarItem || /* mongoose.models.SidebarItem || */ mongoose.model("SidebarItem", SISchema, "sidebar");