I'm using this php package to make queries - https://github.com/jenssegers/laravel-mongodb
The situation is, there are two fields, user_id
and post_status
among others. I want to retrieve all the documents in that collection, but when post_status
field value is draft
, that should be retrieved only when user_id
is a given string. The idea is, only logged in user finds their drafted posts among other posts.
I'm having hard time finding any solution for this problem. The app is still not in production. If I should store data is some different manner, that is an option as well.