implemented changelog
This commit is contained in:
@ -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);
|
Reference in New Issue
Block a user