aboutsummaryrefslogtreecommitdiff
path: root/lib/log.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/log.model.ts')
-rw-r--r--lib/log.model.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/log.model.ts b/lib/log.model.ts
index 7ea9cb9..1904d15 100644
--- a/lib/log.model.ts
+++ b/lib/log.model.ts
@@ -1,8 +1,13 @@
import { model, Model } from 'mongoose';
import schema, { LogDocument } from './log.schema';
+import Connection from './connection';
-const LogModel = model<LogDocument, Model<LogDocument>>('Log', schema);
+export type LogModel = Model<LogDocument>;
+const createLogModel = (connection: Connection): LogModel => {
+ return connection.model<LogDocument, LogModel>('Log', schema);
+};
-export default LogModel;
+
+export default createLogModel;