tp5对于mongodb语句的解析不合理

浏览:1581 发布日期:2016/08/10 分类:ThinkPHP5专区 关键字: mongo thinkphp5
在model中执行以下语句
public static function ***($data = null){
$where = [];

if($data['id']){
$where['id'] = $data['id'];
}

$list = Db::name('textbook')->where($where)->select();
dump($list);exit;
return $list;
}
会生成对应的sql语句,数据没有办法查出来,所以看了下日志中,对于sql的理解,变成了,这样
[ sql ] [ Mongo ] question_bank.qb_textbook.find({"$and":[{"id":"1"}]}); [ RunTime:0.000436s ]
感觉很不合理呢

如何能实现
db.qb_textook.find({id:1})这样的效果
最佳答案
评论( 相关
后面还有条评论,点击查看>>