Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Database/Validator/Query/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function isValidAttributeAndValues(string $attribute, array $values, s
// For dotted attributes on objects, validate as string (path queries)
if ($isDottedOnObject) {
$validator = new Text(0, 0);
continue 2;
break;
}

// object containment queries on the base object attribute
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/Adapter/Scopes/ObjectAttributeTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,16 @@ public function testNestedObjectAttributeEdgeCases(): void
])
]);

try {
$database->find($collectionId, [
Query::equal('profile.level1.level2.level3.level4.value', [10])
]);
$this->fail('Expected nesting as string');
} catch (Exception $e) {
$this->assertInstanceOf(QueryException::class, $e);
$this->assertEquals('Invalid query: Query value is invalid for attribute "profile"', $e->getMessage());
}

$results = $database->find($collectionId, [
Query::equal('profile.level1.level2.level3.level4.value', ['deep_value_1'])
]);
Expand Down
Loading