How do I group by an embedded field using SQL.

David Kihato shared this question 4 years ago
Answered

This is what I mean


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


Replies (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

Leave a Comment
 
Attach a file