UNPKG

@bc443e/mongoose-diff-history

Version:

Manage Mongo Collection diff History and versions. Forked from mongoose-diff-history

19 lines (16 loc) 418 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, index: true } }, { timestamps: true } ); module.exports = { model: mongoose.model('History', historySchema) };