Reputation: 41
I am working with laravel 5.3 and jenssegers-mongodb.
I have following document in MongoDB :
{
"_id" : ObjectId("590fgfhddfgdfgdfgdg"),
"name" : {
"en" : "Meeting",
"gu" : "બેઠક"
},
},
{
"_id" : ObjectId("590fgfhddfgdfgdfgdg"),
"name" : {
"en" : "All",
},
}
I would like to fetch value if (name.gu) is exist, otherwise fetch from (name.en).
Is it possible ?
Upvotes: 3
Views: 759
Reputation: 8199
Solution:
I was able to achieve his using ->whereNull(<column>)
for me check if deleted column do not exists ->whereNull('deleted')
Upvotes: 0