Commit 649e56b
fix(driver-memory): accept the engine QueryAST in aggregate() (analytics fallback) (#1703)
ObjectQL's engine calls driver.aggregate(object, AST) with the same
{ where, groupBy, aggregations } shape find() consumes — but the in-memory
driver's aggregate() only understood MongoDB pipeline arrays, so the
analytics RAW_SQL_UNSUPPORTED fallback (framework#1701) crashed with
"this[#pipeline].map is not a function" on in-memory environments — the
last broken link in dataset queries on staging tenants.
aggregate() now detects the AST shape and serves it through the SAME
where-filter + performAggregation path find() uses (count/sum/avg/min/max,
multi-field groupBy, aliases); a real pipeline array keeps the Mingo
behavior unchanged.
driver-memory: 68 tests green (3 new: grouped sums via AST, where+no-groupBy
single-row totals, pipeline-array passthrough).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent c7c51c4 commit 649e56b
2 files changed
Lines changed: 68 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
752 | 793 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
629 | 653 | | |
630 | | - | |
| 654 | + | |
631 | 655 | | |
632 | 656 | | |
633 | 657 | | |
634 | | - | |
| 658 | + | |
635 | 659 | | |
636 | 660 | | |
637 | 661 | | |
| |||
0 commit comments