5.2.8 Query and Include
The "Query-Include" option allows to specify a query, and the documents returned by that query will be included (rather then showing the query results). This allows to quickly created an aggregated document without needing to manually insert includes.
It is not important what you put in the "select" part of the query, you can simply do "select id where ....".
In the same way as for includes, it is possible to specify that heading-shifting to be performed.