Auto Increment Sequence in NestJs/Mongoose
问题 I'm migrating a NodeJs project to NestJs, this project uses MongoDB as back-end database and Mongoose as ODM. I was using the mongoose-sequence plugin to handle autoincrement sequences, however I'm facing troubles requiring the library under NestJs. The mongoose-sequence documentation explains how to import the library using CommonJS syntax as follows: const mongoose = require('mongoose') const AutoIncrementFactory = require('mongoose-sequence'); const connection = await mongoose