I'm pulling some data from MongoDB with CodeIgniter and I came across a strange thing ... Some records are found and some are not. Debugging the code I saw that the problem was the name it is looking for, but it seems to be because of some character. My code:
$aggregate = array(
array('$match'=>array('culturaNormatizada'=>$cultura, 'ano'=>(int)$ano, 'albaPotential'=>$alba)),
array('$group'=>array('_id'=>'$'.$regiao))
);
$query = $this->mongo_db->aggregate('business_view_final', $aggregate);
The data that it can not find (sometimes) is the variable $ alba . The name Camp-D can not find it, but it exists in the database in the albaPotential column. Changing this name, putting another such as NonGrass (which is another record) normally finds.
It seems to be I do not know if it's the -
or the ( )
, but it's not against some character.