Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jul 1, 2024
1 parent e87f5ed commit 952395e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions docs/guide/en/query/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,26 +239,26 @@ $query->where(['=', $column, $value]);

### array overlaps

Checks if the first array contains at least one element from the second array. Currently supported only by PostgreSQL
and equals to `&&` operator.

Requires two operands:

- Operator 1 should be a column name of an array type or DB expression returning an array;
- Operator 2 should be an array, iterator or DB expression returning an array.

Checks if the first array contains at least one element from the second array. Currently supported only by PostgreSQL
and equals to `&&` operator.

For example, `['array overlaps', 'ids', [1, 2, 3]]` will generate `"ids"::text[] && ARRAY[1,2,3]::text[]`.

### JSON overlaps

Checks if the JSON contains at least one element from the array. Currently supported only by PostgreSQL, MySQL and
SQLite.

Requires two operands:

- Operator 1 should be a column name of a JSON type or DB expression returning a JSON;
- Operator 2 should be an array, iterator or DB expression returning an array.

Checks if the JSON contains at least one element from the array. Currently supported only by PostgreSQL, MySQL and
SQLite.

## Object format

Object format is most powerful yet the most complex way to define conditions.
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ public function testCreateOverlapsConditionFromArrayWithInvalidOperandsCount():
$qb = $db->getQueryBuilder();

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Operator "JSON OVERLAPS" requires three operands.');
$this->expectExceptionMessage('Operator "JSON OVERLAPS" requires two operands.');

$qb->createConditionFromArray(['json overlaps', 'column']);
}
Expand Down

0 comments on commit 952395e

Please sign in to comment.