© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
16 replies
jakeleventhal

Best way to query jsonb field

I can't find any relevent thread other than this one (helpQuerying PG table by JSONB field)

if i have a column like:
myData: jsonb('myData').$type<{a: {b: string} }>().notNull()
myData: jsonb('myData').$type<{a: {b: string} }>().notNull()

what is the best way to find a value where b === 'test'?
does this query work/make sense?
await db.query.someTable.findFirst({ where: eq(someTable.a.b, 'test'});
await db.query.someTable.findFirst({ where: eq(someTable.a.b, 'test'});
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

jsonb field definition.
Drizzle TeamDTDrizzle Team / help
3y ago
JSONB field and zod validation
Drizzle TeamDTDrizzle Team / help
3mo ago
update a nested jsonb field
Drizzle TeamDTDrizzle Team / help
3y ago
What is the best way to join with JSONB arrays with Drizzle?
Drizzle TeamDTDrizzle Team / help
3y ago