Puedes usar el $type
operador con $not
en su consulta para excluir documentos donde age
es una cadena. En el shell, su consulta se vería así:
db.test.find({age: {$not: {$type: 2}}}).sort({age: -1}).limit(1)
O en PHP de Martti:
$cursor = $collection->find(array('age' => array('$not' => array('$type' => 2))), array('age' => 1));
$cursor->sort(array('price' => -1))->limit(1);