I just updated to v4.1.0 and it seems that nested ...
# orm-help
k
I just updated to v4.1.0 and it seems that nested reads for a 1:1 relationship is not working. I'm using the Mongo connector. The FK side does not retrieve info even when I use
include
.
👀 1
✅ 1
a
Hey there! Could you provide your schema, code, and unexpected results?
k
Sorry for the late reply. Basically this:
Copy code
model Profile {
 ...
 user User @relation(fields: [userId], references: [user_id])
 userId String @unique @db.ObjectId
}

model User {
...
profile Profile?
}
The nested write on user seemed to be working find but the
include
did not return the associated profile with :
Copy code
await prisma.user.create({
...
 include: {
   profile: true
 }
}
The same goes for reading :
Copy code
await prisma.user.find({
 include: {
   profile: true
 }
}
I updated to the latest version today and now the first still successfully writes the profiles but also returns the connected profile as expected. However, the second one still does not work.
Ha ha. I solved it. I got a script clearing the db and forgot to stop it and so caused the issue. The code works just fine. I FEEL SHEEPISH LOL
a
No problem, glad you got it figured out!