arraynotcontains filter, closes #1132

This commit is contained in:
Simon Willison 2020-12-07 14:41:03 -08:00
commit 4c25b035b2
3 changed files with 39 additions and 4 deletions

View file

@ -154,7 +154,16 @@ class Filters:
where j.value = :{p}
)""",
'{c} contains "{v}"',
)
),
TemplatedFilter(
"arraynotcontains",
"array does not contain",
"""rowid not in (
select {t}.rowid from {t}, json_each({t}.{c}) j
where j.value = :{p}
)""",
'{c} does not contain "{v}"',
),
]
if detect_json1()
else []