how can i query the inside of a JSON field ?
# orm-help
s
how can i query the inside of a JSON field ?
r
n
Hey Stephan šŸ‘‹ can you give an example of what you want to do exactly? Generally you JSON fields are treated as scalars, so it's not possible to look "into" the stored JSON.
s
i have an entity which has a property called body which is JSON i cant seem to query the content of the field
@Richard Ward 1.34
r
Those doc's wont help then šŸ˜•
s
is there a way to tell my db (mongo) that the field is json and not string can prisma then query inside the json field ?
j
There is an open ticket for this here: https://github.com/prisma/prisma/issues/2444 @nikolasburk This is actually well supported in recent DBMSs - as MySQL likes to advertise it, ā€œNoSQL in MySQLā€. They’re usually well optimized as well, eg postgres’ JSONB type
This is actually a relatively important for an app I’m working on, where there’s a lot of experimental data that can take many forms - it doesn’t map well to a relational structure (I’d have to basically do a fact table, which could get extremely long), but I still want to query on it
Django just recently shipped full support for this in their ORM