use yii\mongodb\Query;
$users = array_keys((new Query())->from('tbl_user')->select(['userid'])->indexBy('userid')->all());
//the result of $users is [1,2,3]
$rzt= $query->from('tbl_log')->where(['in','userid',$users])->count();
//the result of $rzt is 10
but…I got 0 by the flowing code:
$users = (new Query())->from('tbl_user')->select(['userid']);
$rzt = $query->from('tbl_log')->where(['in','userid',$users])->count();
How to use the ‘in’ condition ?