Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const CounterSchema = new Schema({
_id: { type: String, required: true },
count: { type: Number, default: 0 }
}, {
timestamps: true,
collection: 'counters'
module.exports = mongoose.model('CounterModel', CounterSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.