Hey there , I been facing issue with implmenting p...
# mongodb
m
Hey there , I been facing issue with implmenting prisma with already existing mongodb project data not perfect in
production
the main issue is
Copy code
P2023
"Inconsistent column data: {message}"
because I have some fields are unions , could be string or number how to solve this issue ? is there anyway to tell prisma that field type could be string or number? the solution that I have is to put field type as
json
but is there better solution ?
1
h
If you have varying data in a field, you can only use
json
there. There is no way of expressing compounds types in the schema right now.
❤️ 1
m
thanks for sharing that