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: And/Or for inline array filters #621

Closed
Tracked by #28
AndrewSisley opened this issue Jul 11, 2022 · 0 comments · Fixed by #779
Closed
Tracked by #28

Aggregate: And/Or for inline array filters #621

AndrewSisley opened this issue Jul 11, 2022 · 0 comments · Fixed by #779
Assignees
Labels
area/query Related to the query component feature New feature or request

Comments

@AndrewSisley
Copy link
Contributor

Part of #28

Broken out of #392

For example the following test fails as the filter does not support _and/_or.

func TestQueryInlineIntegerArrayWithsWithCountWithAndFilterAndPopulatedArray(t *testing.T) {
	test := testUtils.QueryTestCase{
		Description: "Simple inline array, filtered count of integer array",
		Query: `query {
					users {
						Name
						_count(FavouriteIntegers: {filter: {_and: [{_gt: -2}, {_lt: 2}]}})
					}
				}`,
		Docs: map[int][]string{
			0: {
				(`{
				"Name": "Shahzad",
				"FavouriteIntegers": [-1, 2, -1, 1, 0, -2]
			}`)},
		},
		Results: []map[string]interface{}{
			{
				"Name":   "Shahzad",
				"_count": 4,
			},
		},
	}

	executeTestCase(t, test)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants