import mongoose from "mongoose"; const BrandSchema = new mongoose.Schema( { brandName: { type: String, required: [true, "Name of brand required"], }, image: [ { public_id: { type: String, // required: true, }, url: { type: String, // required: true, }, }, ], addedBy: { type: mongoose.Schema.ObjectId, ref: "User", required: true, }, }, { timestamps: true } ); export const BrandModel = mongoose.model("BrandModel", BrandSchema);