Add the method Mongodb\Query\Builder::toMql() to mimic the Illuminate\Database\Query::toSql(). No need for a toRawSql() equivalent because there is no data binding.
This will help writing comprehensive tests on query builder. PHPORM-33
The MQL format (my proposition)
MQL is a javascript-like format.
The collection name is not in the dumped format.
db.users.find().skip(5).take(10)
[
'find' => [
[],
['skip' => 5, 'limit' => 10]
],
]
Or in split version:
[
'find' => [],
'skip' => [5],
'take' => [10],
]
When chaining, add several calls to the array. This does not accept calls to the same method. But the query builder never use method chaining.
db.users.find({"name.family": "Smith"}).count()
[
'find' => [['name.family' => 'Smith']],
'count' => [],
]
- is depended on by
-
PHPORM-33 Comprehensively test Laravel query syntax
-
- Closed
-