From d9cf132f022812fb850312a801c28b61054855c2 Mon Sep 17 00:00:00 2001 From: theBGuy <60308670+theBGuy@users.noreply.github.com> Date: Sat, 7 Oct 2023 00:26:14 -0400 Subject: [PATCH] Update gridfs.ts - GridFSBucket doesn't pass the file into a callback anymore, instead it sets the value of gridFSFile when the finish event is triggered. --- src/gridfs.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gridfs.ts b/src/gridfs.ts index 86d23a85..624b8ac7 100644 --- a/src/gridfs.ts +++ b/src/gridfs.ts @@ -349,6 +349,10 @@ export class GridFsStorage extends EventEmitter implements StorageEngine { }; const emitFile = (f) => { + if (f === undefined) { + // @ts-ignore - outdated types file this does exist + f = writeStream.gridFSFile; + } const storedFile: GridFile = { id: f._id, filename: f.filename,