Skip to content

Commit 37d5599

Browse files
Both positive and negative tests
1 parent 8e2964b commit 37d5599

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

filter/converter_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,21 @@ func TestConverter_Convert(t *testing.T) {
225225
fmt.Errorf("$exists operator not supported on non-nested jsonb columns"),
226226
},
227227
{
228-
"$exists jsonb column",
228+
"not $exists jsonb column",
229229
filter.WithNestedJSONB("meta"),
230230
`{"name": {"$exists": false}}`,
231231
`(NOT jsonb_path_match(meta, 'exists($.name)'))`,
232232
nil,
233233
nil,
234234
},
235+
{
236+
"$exists jsonb column",
237+
filter.WithNestedJSONB("meta"),
238+
`{"name": {"$exists": true}}`,
239+
`(jsonb_path_match(meta, 'exists($.name)'))`,
240+
nil,
241+
nil,
242+
},
235243
}
236244

237245
for _, tt := range tests {

0 commit comments

Comments
 (0)