UNPKG

mongoose-diff-tracking

Version:
19 lines (16 loc) 405 B
const mongoose = require('mongoose'); const { Schema } = mongoose; const historySchema = new Schema( { collectionName: String, collectionId: Schema.Types.ObjectId, diff: {}, user: {}, reason: String, version: { type: Number, min: 0 } }, { timestamps: true } ); module.exports = { model: mongoose.model('History', historySchema) };