query icon indicating copy to clipboard operation
query copied to clipboard

Aggregate expressions now allowed

Open pietersv opened this issue 4 years ago • 0 comments

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"]}]
      }
    })

pietersv avatar Nov 02 '20 16:11 pietersv