I'm trying to access the MongoDB profiler in PHP with the same query I would use in the mongo client:
$db = $mongo->selectDB('myapp_db');
$array = $db->execute('return db.system.profile.find();');
echo '<pre>' . print_r($array, true);
But I get this:
Array
(
[retval] => Array
(
[value] => DBQuery: myapp_db.system.profile -> undefined
)
[ok] => 1
)
Profiling is enabled and works fine in the client.