Type not assignable to type void
hfournier opened this issue · 4 comments
hfournier commented
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
hfournier commented
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 :)
peterclemenko commented
I just got the same error. Can this fix be put in upstream?