I have this document in the 'families' table:
{
"_id" : {
"$oid" : "51b701a81c1d7bd459000001"
},
"items" : {
"tasks" : [{
"due_date" : "07/06/13",
"assignees" : "[email protected]",
"_id" : {
"$oid" : "51ba0c181c1d7b7c0e00000c"
},
"type" : "task",
"author" : "[email protected]",
"creation_date" : "13/06/2013",
"name" : "Task0"
}
]
}
}
Using Codeigniter's ActiveRecord Library I'm trying to access an element in the 'tasks' array by doing so ( '$item_id' is the id of the task I'm looking for):
$this->mongo_db->where(array('_id' => $this->session->userdata('family_id')))
->where(array('items.$.$._id' => $item_id));
$query = $this->mongo_db->get('families');
So I tried to use the dot notation and the positional operator. But all I get is an empty array.
Please, help, anyone?