techniq/odata-query

$apply GroupBy Transform not capable of producing the query needed

httpete opened this issue · 0 comments

This query works fine:

$apply=groupby(mfs/ID, aggregate(mfs(im_foo with average as Value)))

But odata-query can't produce that nested 'mfs' part wrapped in the aggregate ()

$apply=groupby(mfs/ID, aggregate(mfs(im_foo with average as Value)))

I tried transform with array, or objects, and nothing can produce that string:

  const transform = {
    groupBy: {
      properties: ['mfs/ID'],
      transform: {
        aggregate: [
          'mfs',
          {
            'mfs/im_Jitter': {
              with: 'average',
              as: 'Value',
            },
            'mfs/im_Latench': {
              with: 'average',
              as: 'Value1',
            },
            'mfs/im_PacketLossPercentage': {
              with: 'average',
              as: 'Value2',
            },
          },
        ],
      },
    },
  };