I'm having a problem using a dynamic array to filter the data I want to retrieve from my MongoDB.
I have an array which is stored in $this->x and when I print_r($this->x) the result is the same as before:
Array
(
[0] => 1
[1] => 2
[2] => 54
[3] => 55
)
but the query won't return any values. Query -> $c = $col->find(array('Aliens.Id' => array('$in' => $this->x)));
The strange thing is that when I do the query like this -> $c = $col->find(array('Aliens.Id' => array('$in' => array(1,2,54,55))); it returns values!!
If I print_r(array(1,2,54,55)) the output is:
Array
(
[0] => 1
[1] => 2
[2] => 54
[3] => 55
)
Note: $this->x is also an array.