diff --git a/server/mongo/src/storage.ts b/server/mongo/src/storage.ts index 338920020e..a2fb477485 100644 --- a/server/mongo/src/storage.ts +++ b/server/mongo/src/storage.ts @@ -126,10 +126,10 @@ abstract class MongoAdapterBase implements DbAdapter { translated._class = { $in: classes } } } else if (typeof translated._class === 'object') { - const classesIds = new Set(classes) let descendants: Ref>[] = classes if (Array.isArray(translated._class.$in)) { + const classesIds = new Set(classes) descendants = translated._class.$in.filter((c: Ref>) => classesIds.has(c)) }