Distinct for array of fields in mongo-php

58 views
Skip to first unread message

Setti Mahesh

unread,
Nov 8, 2015, 9:07:25 AM11/8/15
to mongodb-dev
I am trying to find distinct values in array.

mongo query: db.runCommand ( { distinct: "inventory", key: "item.sku", query: { dept: "A"} } )

php: 
$db->command(array("distinct" => "inventory",
                        "key" => "item.sku",
                        "query" => array("dept" => "A")));

I am running above php script but it is returning empty value.
Reply all
Reply to author
Forward
0 new messages