Closed SinBirb closed 2 years ago
I had this issue as well and solved it by adding this code into another types declaration file. It's temporary, but it works.
declare module "mongoose-lean-virtuals" {
import { Schema } from "mongoose";
export default function mongooseLeanVirtuals(schema: Schema): void;
}
we use it like that:
import * as leanVirtualsPlugin from 'mongoose-lean-virtuals';
Schema.plugin(leanVirtualsPlugin);
and it works
When using with
import mongooseLeanVirtuals from "mongoose-lean-virtuals";
it gives the same error as the mongoose-lean-getters plugin: https://github.com/mongoosejs/mongoose-lean-getters/issues/11
Is there some other way to use this plugin?