You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -144,28 +144,17 @@ export class GridFSBucket extends TypedEventEmitter<GridFSBucketEvents> {
144
144
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
// Delete orphaned chunks before returning FileNotFound
152
+
if(deletedCount===0){
153
+
// TODO(NODE-3483): Replace with more appropriate error
154
+
// Consider creating new error MongoGridFSFileNotFoundError
155
+
thrownewMongoRuntimeError(`File not found for id ${id}`);
156
+
}
157
+
},callback);
169
158
}
170
159
171
160
/** Convenience wrapper around find on the files collection */
@@ -215,42 +204,25 @@ export class GridFSBucket extends TypedEventEmitter<GridFSBucketEvents> {
215
204
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
thrownewMongoRuntimeError(`File with id ${id} not found`);
213
+
}
214
+
},callback);
233
215
}
234
216
235
217
/** Removes this bucket's files collection, followed by its chunks collection. */
236
218
drop(): Promise<void>;
237
219
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
0 commit comments