Nested queries with mongodb not working.
Hi guys,
I have run into a roadblock in my project where I need to fetch some data via my search operation.
I have the following relations setup:
Product - Variants: 1-many
Variant - InventoryItems: 1-many
in searching InventoryItems I want to query the title of the nested variants - product.
It seems that this kind of nested query is way too complicated for prisma or my indexes/relations are set up incorrectly.
here is an example of a working query...
But if we switch this to a findMany .. we get a timeout!
Nesting further into the variants connected product modal we are also met with nothing but a timeout.
for context I have 9769 InventoryItems ,1590 products and 14989 Variants.
I have also attached images.
any help would be much appreciated.
![No description](https://cdn.answeroverflow.com/1255869502164439040/Screenshot_2024-06-27_at_14.49.21.png)
![No description](https://cdn.answeroverflow.com/1255869502642720808/Screenshot_2024-06-27_at_14.56.20.png)
![No description](https://cdn.answeroverflow.com/1255869502982324264/Screenshot_2024-06-27_at_14.56.32.png)
![No description](https://cdn.answeroverflow.com/1255869503401627649/Screenshot_2024-06-27_at_14.56.44.png)
6 Replies
Bump!??
@🔨 Moderator
Hi :vmathi: You already bumped your message a few minutes ago, it is not necessary to ping mods for that 🙂
Hey Nicklas,
If I understand correctly, you get a timeout query with this kind of
findMany
query, right?
Does this happen even if you are just fetching 10 records?Hey Nurul, yes it does. Even Take: 2 is timing out.
(The request id was: 8a33a7d42b9c92e5)
(The request id was: 8a33abc59dd492fa)
Is this informative ?
Our team has identified the cause of this timeout.
This happens due to a DNS resolution issue in MongoDB Rust Driver. Our team is i touch with MongoDB team to find a resolution for this.
I will keep you updated with progress fron our end and will share a timeline for the resolution as soon as I have it
Thank you!