// Find users where data column has 'role' key
User.findAll({ where: { data: { [Op.jsonHasKey]: 'role' } } })
// SQL (PostgreSQL): WHERE data ? 'role'
// SQL (MySQL): WHERE JSON_CONTAINS_PATH(data, 'one', '$.role')
// Nested key
User.findAll({ where: { data: { [Op.jsonHasKey]: 'settings.theme' } } })
Helper to create JSON has key condition Checks if JSON column has a specific key