private IAggregateFluent <BsonDocument> GetDefaultReportColumnQuery(string matchClauseName, int[] matchValues, string resultValue) { var matchBuilder = new MatchBuilder(); var groupBuilder = new GroupBuilder(); matchBuilder.BuildClause(matchClauseName, matchValues, MatchType.Integer); groupBuilder.BuildIdClause("'_id'", "'$UserId'"); groupBuilder.BuildResultClause("$sum", resultValue); return(GetCollection().Aggregate() .Match(matchBuilder.Document) .Group(groupBuilder.Document)); }
private BsonDocument GetMatchDocument(ActionsChartConfiguration chartConfiguration) { var matchBuilder = new MatchBuilder(); matchBuilder.BuildClause("ActionStart", chartConfiguration.SelectedActionStart, MatchType.DateRange); matchBuilder.BuildClause("ActionType", chartConfiguration.SelectedActionTypes, MatchType.Integer); matchBuilder.BuildClause("UserId", chartConfiguration.SelectedUserIDs, MatchType.Integer); matchBuilder.BuildClause("EarnType", chartConfiguration.SelectedEarnTypes, MatchType.Integer); matchBuilder.BuildClause("IP", chartConfiguration.SelectedIPS, MatchType.String); matchBuilder.BuildClause("StartDate", chartConfiguration.SelectedStartDate, MatchType.DateRange); return(matchBuilder.Document); }