-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
- Laravel-mongodb Version: 3.2.3
- PHP Version: 7.3
- Database Driver & Version: Mongo DB 4.4, ext-mongo >= 1.9
Description:
Steps to reproduce
- Try to query something using
Class::query()->whereRaw(['_id' => 'some-value'])orClass::query()->whereRaw(['_id' => ['$eq' => 'some-value']])
Expected behaviour
The query should return exactly the same results as Class:query()->where('_id', 'some-value')
Actual behaviour
No result is returned
In my situation I have some subscriptions and some logic that defines general rules for when a customer can see a certain subscription type. However I also need to implement an override (basically customer service wants to specify that user X can see subscription type Y even though this doesn't follow the standard rules). To do this I want to write a query like:
->whereRaw([
'$or' => [$set_of_standard_rules, ['_id' => ['$in' => $user_overrides]]]
])
However the _id part is never matched, even when using the basic query whereRaw(['_id' => 'some-value']) or whereRaw(['_id' => ['$eq' => 'some-value']]).
Metadata
Metadata
Assignees
Labels
No labels