const mongoose = require('mongoose'); const counterSchema = new mongoose.Schema({ _id: { type: String, required: true }, // This stores the key like "Silver_181225" seq: { type: Number, default: 0 } // This stores the running count }); // Important: We export the Model directly module.exports = mongoose.model('Counter', counterSchema);