text: var mongoose = require("mongoose");
  var schema = mongoose.Schema;
  //var objectID = mongoose.Schema.objectID;
  
  const categorySchema = schema(
    {
      //_id : {type: objectID, auto: true},
      category_name: { type: String, required: true, unique: true },
      details: { type: String, required: false },
      public: { type: String, required: false },
      images: [{ type: String, required: false }],
      videos: [{ type: Number, required: false }],
      maker: { type: mongoose.Schema.Types.ObjectId, ref: "Users" }
    },
    { timestamps: true }
  );
  
  categorySchema.method("toJSON", function () {
    const { __v, _id, ...object } = this.toObject();
    object.id = _id;
    return object;
  });
  
  module.exports = mongoose.model("Category", categorySchema);
  