Hi,
How we can avoid "Undefined offset: 0" error When the cursor is empty in koolreport/packages/mongodb/MongoDataSource.php in Line 106
Please find below our piece of code
`
$start = strtotime(date($this->params['dateRange'][0]));
$end = strtotime(date($this->params['dateRange'][1]));
$stops_source = $this->src("mongodb")
->query([
"collection" => "stops",
"find" => [
'organization_id' => '3',
'place_id' => [
'$exists' => true,
'$not' => ['$type' => 10]
],
'duration' => [
'$exists' => true,
'$not' => ['$type' => 10]
],
'started_at' => [
'$exists' => true,
'$gte' => new \MongoDB\BSON\UTCDateTime($start * 1000),
'$lte' => new \MongoDB\BSON\UTCDateTime($end * 1000)
]
],
])
->pipe(new ColumnRename(array(
"_id"=>"stopid",
)))
->pipe(new Group(array(
"by"=>array("place_id"),
"count"=>array("stopid"),
"avg"=>array("duration"),
)))
->saveTo($s1)
->pipe($this->dataStore("stops"));