I have a sub array which consists of object ids
"selections" : ["5176d1f09de5ee2808028da9", "5176d1f09de5ee2808028e4d", "5176d1f09de5ee28080292fe", "5176d1f19de5ee2808029867"]
When users log in, these are registered using PHP sessions:
var_dump($selections);
array(16) { [0]=> string(24) "5176d1f09de5ee2808028a7c" [1]=> string(24) "5176d1f09de5ee2808029180" [2]=> string(24) "5176d1f09de5ee2808029283" [3]=> string(24) "5176d1f19de5ee280802990c"}
I get them from sessions and then use them in a query:
$selectionsFromSession= $_SESSION['selections'];
$list=$collection->find(array("_id"=>array('$in'=> $selectionsFromSession )), ....
This query returns nothing. What can be the problem here?