i need to find the most recent element, the field "data_caricamento" save the date. so i made a index with MognoDb shell:
db.collection.ensureIndex({"data_caricamento": -1})
and with the php code below i have what i need
$cursor=$collection->find();
$cursor->sort(array("data_caricamento"=> -1));
$cursor->limit($n);
but i think that should be a better way to do it, for example there is a way to query the directly the index? thx.