Open indicozy opened 2 years ago
Hi guys, i have a similar issue.
In my prisma schema definition, i have a model that has an embedded document as field using type definition. That type definition has a field like String[]
:
model myModel {
id String @id @default(auto()) @map("_id") @db.ObjectId
info MyType
}
type MyType {
field String[]
}
so, in playgroud when i try to create a new MyModel Document i have to use a mutation similar to this:
mutation {
createMyModel(
data:{
info:{set:["s1"]}
})
}
but, prisma show me this error message:
The current database provider doesn't support a feature that the query used: Unhandled and unsupported value mapping for MongoDB: { \"set\": [String(\"s1\")] } as String."
if i change the field type from String[] to Json there aren't problem. I really appreciate your help
if i change the MyType definition to
type MyType {
field Json
}
i don't have any problems but that's not an option if you will has a typed code
Next step: Reconfirm bug again with most recent Prisma version, compare error message according to https://github.com/prisma/team-orm/issues/222.
Hi guys, i have a similar issue. In my prisma schema definition, i have a model that has an embedded document as field using type definition. That type definition has a field like
String[]
:model myModel { id String @id @default(auto()) @map("_id") @db.ObjectId info MyType } type MyType { field String[] }
so, in playgroud when i try to create a new MyModel Document i have to use a mutation similar to this:
mutation { createMyModel( data:{ info:{set:["s1"]} }) }
but, prisma show me this error message:
The current database provider doesn't support a feature that the query used: Unhandled and unsupported value mapping for MongoDB:
{ \"set\": [String(\"s1\")] } as String."
if i change the field type from String[] to Json there aren't problem. I really appreciate your help
I am able to reproduce this issue using Prisma 5.4.2. Any updates or workarounds ? This makes it impossible to use embedded arrays altogether with the MongoDB connector
Bug description
I've decided to try embedding mongodb documents with the new update, however, when the transaction cannot pass the error shows the wrong error type. The error was in the different type of mutation data and the schema's type, however, the error shows that it cannot find the document that I'm trying to create.
How to reproduce
Unknown arg
dataCode
in data.data.dataCode for type SubmissionDataCreateEnvelopeInput. Did you meanset
? Available args: type SubmissionDataCreateEnvelopeInput { set?: SubmissionDataCreateInput }Schema snippet:
unused 'columns' were commented out.
Environment & setup
Prisma Version