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,8 +1,15 @@
import mongoose from 'mongoose';
import db from '../db';
const NoteFieldSchema = new mongoose.Schema({
name: {type: String, index: {unique: true}},
qty: Number
});
export default mongoose.model('note_field', NoteFieldSchema);
// changelog query helper
NoteFieldSchema.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_field', NoteFieldSchema);