Using Mongoose ORM for MongoDB
I've declared a mongoose static method like:
ConvoDataSchema.statics.randomItem = async function () { ... }
and then create a model with that
const ConvoData = mongoose.model('ConvoData', ConvoDataSchema)
but later when I want to call the method:
let convoData = await ConvoData.randomItem()
My linter is not aware that ConvoData
has had this magical method patched onto it by Mongoose.
How can I declare these methods such that a Linter (TSLint / VSCode Intellisense) can properly discover these methods?