Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate expressions now allowed #7

Open
pietersv opened this issue Nov 2, 2020 · 0 comments
Open

Aggregate expressions now allowed #7

pietersv opened this issue Nov 2, 2020 · 0 comments

Comments

@pietersv
Copy link
Contributor

pietersv commented Nov 2, 2020

Basic aggregate expressions are now allowed in queries with $expr paralleling MongoDB. Currently only a few of myriad expressions are implemented here, including $sum, $min, $max and a non-standard extension $same

 var rows = [
      {x0: 0, x1: 50, x2: 30},
      {x0: 10, x1: 50, x2: 40},
      {x0: 25, x1: 50, x2: 30},
      {x0: 40, x1: 50, x2: 10},
    ]

    var r1 = Query.query(rows, {
        $expr: {
          $eq: [100, {$sum: ["x0", "x1", "x2"]}]
      }
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant