Currently, I am attempting to convert the output of mongoose.Model.find(..) into an Observable by utilizing rxjs.from().
My issue lies in my inability to convert the result of .find to a Promise while working with Typegoose.
MyClassModel.find({}) as Promise<MyClass>
Upon trying this approach, I encounter a TS error: Conversion of type 'DocumentQuery, InstanceType, {}>' to type 'Promise' may be a mistake because neither type sufficiently overlaps with the other. If intentional, consider converting the expression to 'unknown' first.
Despite no success, I also attempted:
MyClassModel.find({}) as Promise<DocumentQuery<InstanceType<MyCLass>, InstanceType<MyClass>>
Unfortunately, this did not yield any positive results either.
Has anyone faced a similar situation before?