How do I group by an embedded field using SQL.

David Kihato shared this question 2 months ago
Answered

This is what I mean


select "parent.child" as grp, count(*) from document group by grp


Comments (1)

photo
1

try

    

select parent.child, count(*) from document group by parent.child

There is a problem with grouping field aliases. BTW, Turn on "Menu->Options->VerboseShell" to view the generated mongoshell script