Simple reports can be produced by navigating to URLs of the format /#/analyse/modelname - see example here.
More useful reports can be run by passing an aggregation pipeline to the server using the format /#/analyse/model?r=[pipeline] - for example /#/analyse/g_conditional_fields?r=[{"$group":{"_id":"$sex","count":{"$sum":1}}}] produces a breakdown of the men and women in a collection.
Reports can be enhanced by passing an object containing the pipeline as a property, along with a number of options:
param + ' ' + record.surname | uppercasewould concatenate the values fom the current parameter and the surname parameter and convert them to uppercase.
Use of date parameters is quite tricky. The following works (quotes omitted for clarity):
reportSchema = { pipeline: [ { '$match': {$and : [{birth : {$lt:"(periodFinish)"}},{birth : {$gt:"(periodStart)"}}]}}, {$group:{_id:'People',count:{$sum:1}} ], params: { periodStart: {value: "1800-01-01T00:00:00.000Z", type: 'text', add: 'ui-date ui-date-format ', conversionExpression: "param | date:'yyyy-MM-ddThh:mm:ss.sssZ'"}, periodFinish: {value: "2099-01-01T00:00:00.000Z", type: 'text', add: 'ui-date ui-date-format ', conversionExpression: "param | date:'yyyy-MM-ddThh:mm:ss.sssZ'"} } };
Using these options the report above can be tidied up.
If you looked at the link to that last report you would have realised that using the URL to specify a report format quickly becomes unmanageable. A neater alternative is to put the options into an object which is served up via a static in the model file - see here for some examples.