node-mongoose-audit
v0.2.2
Published
A mongoose audit plugin
Downloads
4
Maintainers
Readme
Database Audit Package
This package provides functionality for auditing database changes in mongoose.
Installation
To install the package, run the following command:
npm install node-mongoose-audit
Setting up Database Connection
import { initConnection } from 'node-mongoose-audit';
Provide Database Uri
initConnection(uri);
Usage
To add after defining your schema: example:
import mongoose from 'mongoose';
import diffHistory from 'node-mongoose-audit';
const testSchema = new mongoose.Schema({
someField: String,
some: {
deepField: String
}
});
testSchema.plugin(diffHistory);