I have a nested document saved up in MongoDB and I wanted to fetch it all since I know the ID
I can select a few fields like this
public function actionFetchId()
{
$data = json_decode(file_get_contents("php://input"), TRUE);
$recordid = (string)$data['dh'];
$collection = Yii::$app->mongodb->getCollection('properties');
//Create Properties List Object
$basic_info_query = new Query;
$basic_info_query->select(['finalize'])
->from('properties')
->where(['_id' => $recordid]);
$rows = $basic_info_query->all();
return json_encode($recordid);
}
and I can assemble my fields I want to fetch here
$basic_info_query->select(['finalize','basic_info'])
However, I would like to fetch all fields in the document. How can I fetch all document fields like in SQL select * from properties in Yii2 Mongo?