Skip to content

Commit

Permalink
fixup! Add support for inline array aggregate filters
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Jul 12, 2022
1 parent ca75b03 commit ad2394b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 32 deletions.
18 changes: 10 additions & 8 deletions tests/integration/query/inline_array/with_average_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ func TestQueryInlineIntegerArrayWithAverageWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"FavouriteIntegers": [-1, 2, -1, 1, 0]
}`)},
`{
"Name": "Shahzad",
"FavouriteIntegers": [-1, 2, -1, 1, 0]
}`,
},
},
Results: []map[string]interface{}{
{
Expand All @@ -54,10 +55,11 @@ func TestQueryInlineFloatArrayWithAverageWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"FavouriteFloats": [3.4, 3.6, 10]
}`)},
`{
"Name": "Shahzad",
"FavouriteFloats": [3.4, 3.6, 10]
}`,
},
},
Results: []map[string]interface{}{
{
Expand Down
36 changes: 20 additions & 16 deletions tests/integration/query/inline_array/with_count_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ func TestQueryInlineBoolArrayWithCountWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"LikedIndexes": [true, true, false, true]
}`)},
`{
"Name": "Shahzad",
"LikedIndexes": [true, true, false, true]
}`,
},
},
Results: []map[string]interface{}{
{
Expand All @@ -54,10 +55,11 @@ func TestQueryInlineIntegerArrayWithCountWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"FavouriteIntegers": [-1, 2, -1, 1, 0]
}`)},
`{
"Name": "Shahzad",
"FavouriteIntegers": [-1, 2, -1, 1, 0]
}`,
},
},
Results: []map[string]interface{}{
{
Expand All @@ -81,10 +83,11 @@ func TestQueryInlineFloatArrayWithCountWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"FavouriteFloats": [3.1425, 0.00000000001, 10]
}`)},
`{
"Name": "Shahzad",
"FavouriteFloats": [3.1425, 0.00000000001, 10]
}`,
},
},
Results: []map[string]interface{}{
{
Expand All @@ -108,10 +111,11 @@ func TestQueryInlineStringArrayWithCountWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"PreferredStrings": ["", "the previous", "the first", "empty string"]
}`)},
`{
"Name": "Shahzad",
"PreferredStrings": ["", "the previous", "the first", "empty string"]
}`,
},
},
Results: []map[string]interface{}{
{
Expand Down
18 changes: 10 additions & 8 deletions tests/integration/query/inline_array/with_sum_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ func TestQueryInlineIntegerArrayWithSumWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"FavouriteIntegers": [-1, 2, -1, 1, 0]
}`)},
`{
"Name": "Shahzad",
"FavouriteIntegers": [-1, 2, -1, 1, 0]
}`,
},
},
Results: []map[string]interface{}{
{
Expand All @@ -54,10 +55,11 @@ func TestQueryInlineFloatArrayWithSumWithFilter(t *testing.T) {
}`,
Docs: map[int][]string{
0: {
(`{
"Name": "Shahzad",
"FavouriteFloats": [3.1425, 0.00000000001, 10]
}`)},
`{
"Name": "Shahzad",
"FavouriteFloats": [3.1425, 0.00000000001, 10]
}`,
},
},
Results: []map[string]interface{}{
{
Expand Down

0 comments on commit ad2394b

Please sign in to comment.