网上查了很多资料,基本上是原生方法,或者是只能查询一条:
以上为例,是否可以查询该表中所有数据的"_id"字段?
No conditions, then specify the query field
$criteria = new EMongoCriteria(); $criteria->sort('posts_count',EMongoCriteria::SORT_DESC) ->limit(25) ->offset(0); $test_id = Group::model()->findAll($criteria); $test_id->next(); $_ids = array(); $name_id = array(); while($row = $test_id->current()){ $t = $row->attributes; $name_id[] = array_splice($t,0,2); $_ids[] = $name_id; $test_id->next(); } $test_id = $_ids[count($_ids)-1]; This is a last resort solution, but it feels so stupid.
No conditions, then specify the query field
$criteria = new EMongoCriteria();
$criteria->sort('posts_count',EMongoCriteria::SORT_DESC)
->limit(25)
->offset(0);
$test_id = Group::model()->findAll($criteria);
$test_id->next();
$_ids = array();
$name_id = array();
while($row = $test_id->current()){
$t = $row->attributes;
$name_id[] = array_splice($t,0,2);
$_ids[] = $name_id;
$test_id->next();
}
$test_id = $_ids[count($_ids)-1];
This is a last resort solution, but it feels so stupid.