Skip to content

Commit a32778b

Browse files
abnegateclaude
andcommitted
(fix): include null tenant in MongoDB metadata collection queries
The SQL adapter correctly adds `OR _tenant IS NULL` for metadata collections, but the MongoDB adapter was missing the equivalent null value in its `$in` array, excluding collection definitions created with a null tenant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2c3cc09 commit a32778b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Database/Adapter/Mongo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ public function getTenantFilters(
24582458
// Include both tenant-specific and tenant-null documents for metadata collections
24592459
// by returning the $in filter which covers tenant documents
24602460
// (null tenant docs are accessible to all tenants for metadata)
2461-
return ['$in' => $values];
2461+
return ['$in' => [...$values, null]];
24622462
}
24632463

24642464
if (empty($values)) {

0 commit comments

Comments
 (0)