Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Allow column aliasing #7

Open
tannerlinsley opened this issue Mar 20, 2016 · 0 comments
Open

Allow column aliasing #7

tannerlinsley opened this issue Mar 20, 2016 · 0 comments

Comments

@tannerlinsley
Copy link
Contributor

If an aggregation is the only nested item in an alias, then the resulting data should be flatten into that alias, eg.

.query({
  groupBy: 'type',
  select: {
    myColumn: {
      $sum: 'total'
    }
  }
})

should result in:

[{
  key: 'type1',
  value: {
    myColumn: 30
  }
}, {
  key: 'type2',
  value: {
    myColumn: 15
  }
}, {
  key: 'type3',
  value: {
    myColumn: 24
  }
}, {
  key: 'type4',
  value: {
    myColumn: 12
  }
}]

this should also work with the string syntax. eg.

.query({
  groupBy: 'type',
  select: {
    myColumn: '$sum(total)'
  }
})
@tannerlinsley tannerlinsley changed the title Allow for column aliasing Allow column aliasing Mar 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant