我写了像mongo db查询
$outputTotalResults= $this->db->studentTbl->aggregate(
array(
array(
'$addFields' => array(
'weight' => array(
'$cond' => array(
array(
'$or' => array(
array(
'$eq' => array(
array('$concat' => array('$first_name', ' ', '$middle_name', ' ', '$last_name')),
$arg
)
),
array(
'$eq' => array(
array('$concat' => array('$first_name', ' ', '$middle_name')),
$arg
)
),
array(
'$eq' => array(
array('$concat' => array('$first_name', ' ', '$last_name')),
$arg
)
)
)
),
10,
0
)
)
)
),
array(
'$sort' => array( 'weight'=> -1 )
)
)
);
我正在尝试对学生进行排序。上面的代码抛出错误“无法识别的管道阶段名称:'$ addFields''”
请帮帮我!!!