If I had a collection of documents like the following:
{a:'1', b:'2', c:'3', d:'a'},
{a:'1', b:'2', c:'1', d:'b'},
{a:'1', b:'2', c:'3', d:'c'},
{a:'1', b:'3', c:'1', d:'d'},
{a:'1', b:'2', c:'3', d:'e'},
{a:'2', b:'2', c:'1', d:'f'}
What would be the most efficient mongo query to get all the unique combinations of the attributes a, b, c? Is it possible? The result looking something like:
{a:'1', b:'2', c:'3', d:*},
{a:'1', b:'2', c:'1', d:*},
{a:'1', b:'3', c:'1', d:*},
{a:'2', b:'2', c:'1', d:*}
*
= don't care
Thanks, your help is appreciated.