groups
The method allows to query collection groups. It’s available as an extension that you import separately:
The method accepts the database instance as the argument and returns a collections groups wrapper.
→ Read the collection group guide
API
All collections groups have altered methods available:
all
- reads all documents in the groupquery
- queries the groupcount
- counts all documents in the groupsum
- sums give document field values in the groupaverage
- calculates the average of given document field values in the group
Unlike the regular all
and query
, reading collection group will return mixed document types.