1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

fix: database query value limits

This commit is contained in:
Torsten Dittmann 2021-12-28 18:57:24 +01:00
parent b05680cf7d
commit 1a5712017b

View file

@ -1717,7 +1717,15 @@ App::get('/v1/database/collections/:collectionId/documents')
}
}
$queries = \array_map(fn ($query) => Query::parse($query), $queries);
$queries = \array_map(function ($query) {
$query = Query::parse($query);
if (\count($query->getValues()) > 100) {
throw new Exception("You cannot use more than 100 query values on attribute '{$query->getAttribute()}'", 400);
}
return $query;
}, $queries);
if (!empty($queries)) {
$validator = new QueriesValidator(new QueryValidator($collection->getAttribute('attributes', [])), $collection->getAttribute('indexes', []), true);