Archived
2

implemented changelog

This commit is contained in:
VLE2FE
2020-06-05 08:50:06 +02:00
parent 74080d0902
commit ca29cef48c
33 changed files with 905 additions and 112 deletions

View File

@ -1,4 +1,5 @@
import mongoose from 'mongoose';
import db from '../db';
const NoteSchema = new mongoose.Schema({
comment: String,
@ -9,4 +10,10 @@ const NoteSchema = new mongoose.Schema({
custom_fields: mongoose.Schema.Types.Mixed
});
export default mongoose.model('note', NoteSchema);
// changelog query helper
NoteSchema.query.log = function <Q extends mongoose.DocumentQuery<any, any>> (req) {
db.log(req, this);
return this;
}
export default mongoose.model<any, mongoose.Model<any, any>>('note', NoteSchema);