Php mongodb中的If条件问题
我对mongodb中的“if条件”有问题。我在这里使用php。我有两个字段“完成日期”和“可用日期”。现在我使用下面的代码Php mongodb中的If条件问题,php,mongodb,if-statement,Php,Mongodb,If Statement,我对mongodb中的“if条件”有问题。我在这里使用php。我有两个字段“完成日期”和“可用日期”。现在我使用下面的代码 $obj = $this->mongo_db; $obj->where(array('status' => 'y')); $obj = $obj->where_between("complete_date",$arr['filter_from'],$arr['filter_to']); $res = $obj->ge
$obj = $this->mongo_db;
$obj->where(array('status' => 'y'));
$obj = $obj->where_between("complete_date",$arr['filter_from'],$arr['filter_to']);
$res = $obj->get('school');
我需要根据条件更改上述条件中的“完整日期”和“可用日期”字段。以下是我的情况,
if(complete\u date
则使用complete\u date
否则请使用可用的日期
这两个字段都在集合中
如何在上面的mongodb查询中实现这个if条件