Yii - Mongodb Collections Data In Cgridview

Im trying to populate Cgridview with Mongo data, but getting error "Undefined offset: 0"

Here is my coding,


 $sql="SELECT name FROM CRM_Field Where crm_base_contact_id = ".$base;

    $names =Yii::app()->db->createCommand($sql)->query()-> readAll();

    $mongo = new Mongo( Yii::app()->mongodb->connectionString);

    $collection = $mongo->test->crm_contact_tmp;

    $mongocol = $mongo->test->crm_contact_tmp->find(array('crm_base_contact_id' => array('$in' => array($base))));

    $arrayDataProvider = new CArrayDataProvider (iterator_to_array($mongocol) );

?>


<?php $this->widget('zii.widgets.grid.CGridView', array(

    'id' =>'BCImported-grid',

    'dataProvider' =>$arrayDataProvider,

    $cc->findAllByAttributes($cc->attributes),

    'columns' => $names,

)); ?>

what mistake im doing ???

[color=#000000]Hi,[/color][color=#000000]Please check this line… is this correct?[/color][color=#000000]$cc[/color][color=#666600]->[/color][color=#000000]findAllByAttributes[/color]color=#666600,[/color]

Hi thanks for your reply, i removed this line still same error comes…wat to do???