Skip to content

Instantly share code, notes, and snippets.

@mhdatie
Created July 19, 2017 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhdatie/37f6f62e2f877ee76b475425650529c0 to your computer and use it in GitHub Desktop.
Save mhdatie/37f6f62e2f877ee76b475425650529c0 to your computer and use it in GitHub Desktop.
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