Having some trouble issuing a simple query from the PHP Mongo driver. This is the shell query:
db.testing.distinct('summary.type').sort();
According to the documentation, I can do a db->command
to use the distinct query. Here is what I've tried:
$all_types = $db->command(
array(
"distinct" => "summary.type",
"key" => "summary.type"
)
);
var_dump($all_types);
But rather than getting back the data I expect, I only get a cursor with indexes like stats
, nscanned
and nscannedObjects
What am I doing wrong?
Thanks, ns