In this technical report, we present a formalisation of the MongoDB aggregation framework. Our aim is to identify a fragment that could serve as the starting point for an industry-wide standard for querying JSON document databases. We provide a syntax and formal semantics for a set of selected operators, We show how this fragment relates to known relational query languages. We explain how our semantics differs from the current implementation of MongoDB, and justify our choices. We provide a set of algebraic transformations that can be used for query optimisation.
翻译:在本技术报告中,我们提出了MongoDB聚合框架的形式化规范。我们的目标是确定一个可作为行业标准起点的子集,用于查询JSON文档数据库。我们为选定的一组运算符提供了语法和形式语义,展示了该子集与已知关系查询语言之间的关联。我们解释了当前语义与MongoDB现有实现的差异,并论证了设计选择的合理性。最后,我们提出了一组可用于查询优化的代数转换规则。