diff --git a/server/mongo/src/storage.ts b/server/mongo/src/storage.ts index bf01af5cc7..a0cbce0118 100644 --- a/server/mongo/src/storage.ts +++ b/server/mongo/src/storage.ts @@ -845,6 +845,7 @@ abstract class MongoAdapterBase implements DbAdapter { let d = await ctx.with('next', { mode }, async () => await iterator.next()) if (d == null && mode === 'hashed') { mode = 'non-hashed' + await iterator.close() iterator = coll.find({ '%hash%': { $in: ['', null] } }) d = await ctx.with('next', { mode }, async () => await iterator.next()) }