nartc/nest-mean

Type not assignable to type void

hfournier opened this issue · 4 comments

In base.service.ts the return line in clearCollection(), gives:
Type '{ ok?: number; n?: number; }' is not assignable to type 'void'.ts(2322)
I copy and pasted that section of the code from here to make sure there were no mistakes.
@nestjs 5.7.3
typegoose 5.5.0
typescript 3.3.3

Got rid of the error by changing the code to:
async clearCollection(filter = {}): Promise<{ ok?: number, n?: number }> { return this._model.deleteMany(filter).exec(); }

nartc commented

@hfournier I believe that’s due to newer version of mongoose :)

I just got the same error. Can this fix be put in upstream?

nartc commented

@AoiGhost Just updated the repo with the latest version of NestJS. Check out the commit log.