1

i have a collection "website" which data structure is like

[_id] => MongoId Object (
    [$id] => 57beda7f0640fd14ca5cc307
)
[website] => MongoId Object (
    [$id] => 57beda3d279871c80e8b4567
)
[url] => https://acb.com
[meta_tags] => Array (
    [description] => 
    [title] => Login 
    [title_length] => 18    
) 

ans same i have 10 rows of data.

now i am using laravel eloquent and i need to fetch all data which website is 57beda3d279871c80e8b4567 and title is empty or null.

who should i update my query for title attribute

 $this->website->where('website', $website)->get();

Thanks.

1 Answer 1

3

Add another where condition:

$this->website
->where('website', $website)
->where('meta_tags.title', '=','')
->whereNull('meta_tags.title')
->get();

Laravel documentation: https://laravel.com/docs/5.2/queries

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.