Closed as not planned
Description
- Laravel-mongodb Version: 4.1.x-dev
- PHP Version: 8.2.14
- Database Driver & Version:
Description:
The whereAny
and whereAll
query are not generating accurate mongo queries as it does in SQL. https://laravel.com/docs/10.x/queries#where-any-all-clauses
Steps to reproduce
- perform a
whereAny
orwhereAll
query on a collection - chain
toMql()
to see the query output
Expected behaviour
for example a whereAny
query
Model::whereAny(['title','text','shortcut','first_line'], 'like', '%-p%')->toMql();
should look like this
[
'find' => [
'$or' => [
['title' => new \MongoDB\BSON\Regex('^.*\-p.*$', 'i')],
['text' => new \MongoDB\BSON\Regex('^.*\-p.*$', 'i')],
['shortcut' => new \MongoDB\BSON\Regex('^.*\-p.*$', 'i')],
['first_line' => new \MongoDB\BSON\Regex('^.*\-p.*$', 'i')],
],
],
]
Actual behaviour
Instead this is what I see
[
'find' => [
'any' => [
0 => ['title' => true],
1 => ['text' => true],
2 => ['shortcut' => true],
3 => ['first_line' => true],
],
]
]