I need your help please. I am using MongoDB aggregation pipelines for displaying a complex report. Requirements are changing often and product wants our DBA to be able to change quickly the report pipeline. Even more they want the report to differ based on the client using it, for multitenancy. We do not have a report builder because e use many different stages that would be hard to express. Currently I am using Spring Data MongoDB to execute the aggregation pipelines like this:
@Aggregation(pipeline = {...<pipeline JSON>
public AggregationResults<ReportBaseModel> runReport(...);
How could I store the aggregation pipeline in the database as a document so that I can easily read/modify it, and run it with some date period parameters?
Tried Spring Data MongoDB but that means the pipeline is hardcoded into the Java code. I do not want the JSON to be hardcoded.