1
2
3
4
5
from sqlalchemy import func

query_ = query_.filter(
func.json_extract(models.Person.data, f'$.{key}') == value,
)