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: Allow filter defined within aggregate for group #99

Closed
Tracked by #28
AndrewSisley opened this issue Dec 16, 2021 · 3 comments · Fixed by #426
Closed
Tracked by #28

Aggregate: Allow filter defined within aggregate for group #99

AndrewSisley opened this issue Dec 16, 2021 · 3 comments · Fixed by #426
Assignees
Milestone

Comments

@AndrewSisley
Copy link
Contributor

Part of #28

Is fairly important to be able to do this, particularly for top level aggregates:

query {
    _count(users, filter: {Age: {_gt: 26}})
}
@jsimnz
Copy link
Member

jsimnz commented Dec 17, 2021

just for reference:

query {
    user(filter: {Age: {_gt: 26}}) {
          _count
    }
}

_count equivalent to _count(*) from SQL

@jsimnz
Copy link
Member

jsimnz commented Dec 17, 2021

Part of #28

Is fairly important to be able to do this, particularly for top level aggregates:

query {
    _count(users, filter: {Age: {_gt: 26}})
}

quick edit:

query {
    _count(collection: users, filter: {Age: {_gt: 26}})
}

@AndrewSisley
Copy link
Contributor Author

query {
  author {
    name
    numberOfBooks: _count(field: books, filter:  {rating: {_gt: 4}})
  }
}

@jsimnz jsimnz added this to the DefraDB v0.3 milestone Feb 8, 2022
@AndrewSisley AndrewSisley self-assigned this May 2, 2022
@AndrewSisley AndrewSisley changed the title Aggregate: Allow filter defined within aggregate Aggregate: Allow filter defined within aggregate for group May 9, 2022
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

Successfully merging a pull request may close this issue.

2 participants