I am performing aggregation command in mongodb php application like below lines of code.
<?php
$query = array('$or' => array(
array('employeeList'=>array('$exists' => false)),
array('employeeList'=>array('$eq' => null)),
array('employeeList'=>array('$eq' => ",")),
array('employeeList'=>array('$eq' => ""))
));
$pipeline = array(
array(
'$match' => $query
),
array(
'$lookup' => array(
'from' => 'userTbl',
'localField' => 'user_id',
'foreignField' => 'uid',
'as' => 'userdetails'
)
),
);
$output = $this->db->broadcastTbl->aggregate($pipeline);
$result =array();
array_push($result, $output);
Now the output is displayed as
[{"waitedMS":0,"result":[{"_id":{"$id":"58d7a6561d78597411000029"},"broadcast_id":35,"studentList":"","employeeList":"999","mailTitle":"hello","broadcastMessage":"how","emailSent":"0","userdetails":[]},{"_id":....
...
"ok":1}]
I want to remove "waitedMS":0. "result":, and "ok":1 from the json. The output should be like
[{"_id":{"$id":"58d7a6561d78597411000029"},"broadcast_id":35,"studentList":"","employeeList":"999","mailTitle":"hello","broadcastMessage":"how","emailSent":"0","userdetails":[]}, ...
]
Please help me !!!