dsasd12314 2015-04-04 18:19
浏览 370

Yii2 mongodb查询选择查询

For example, I have this MongoDB:

In yii2, I want to write a query to find an email = 'abc'. I have this code:

 $query->select([])->from('Post')->where(['Comments.Email' => 'abc']);

But it does not work; please help me, as I'm beginner in Yii2 and MongoDB.

  • 写回答

3条回答 默认 最新

  • doumeikuan6834 2015-11-18 04:37
    关注

    You can try this

    Document::find()->where(["comments"=>["document"=>["email"=>"abc"]]])->all();
    
    评论
编辑
预览

报告相同问题?