diff options
author | eug-vs <eug-vs@keemail.me> | 2020-12-02 15:26:25 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-12-02 15:26:25 +0300 |
commit | f8ebf581f8272615f48ce355c6b2cbf8248c73bd (patch) | |
tree | 9473834f4045a9375dc0db48f042f4a6df0e016c /lib/connection.ts | |
parent | 994e0df96267b3de4d82926555ac4c4c7eefe14a (diff) | |
download | mongo-cronjob-f8ebf581f8272615f48ce355c6b2cbf8248c73bd.tar.gz |
feat: export client class
Diffstat (limited to 'lib/connection.ts')
-rw-r--r-- | lib/connection.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/connection.ts b/lib/connection.ts new file mode 100644 index 0000000..17ea59a --- /dev/null +++ b/lib/connection.ts @@ -0,0 +1,12 @@ +import { model, Model } from 'mongoose'; + +// An interface for mongoose.connection +export interface Connection { + model: typeof model; + models: Record<string, Model<any, any>>; + dropCollection: (name: string) => Promise<void>; +} + + +export default Connection; + |