Welcome
Login
Sign up
Home
Solutions
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
JavaScript
Nested relations
y
yegovik
started a topic
over 6 years ago
Hello! I am using Angular. I have some nested relations between collections. My collections look like this:
collection1{
name:{"_type":"KinveyRef","_collection":"collection2","_id":"someId"}
}
collection2{
name:{"_type":"KinveyRef","_collection":"collection3","_id":"someId"}
}
collection3{
name:"coolName"
}
I try to fetch data from collection1 with information from collections 2 and 3. I make request:
var promise = $kinvey.DataStore.find('collection1', null, {relations: { name:"collection2"}});
But in response I have just reference to collection3.
How I can modify my request to get info from collection3? Help me please.
1 Comment
M
Mark
said
over 6 years ago
Yes, in order to also resolve the reference to collection3, you’d have to include it in the relations option:
```
$kinvey.DataStore.find('collection1', null, {
relations: {
name: "collection2",
"name.name": "collection3"
}
});
```
Login
or
Signup
to post a comment
More topics in
JavaScript
How do I use Kinvey in my web app?
Is it safe to include keys/secrets in my client-side JavaScript app?
Why is the activeUser null even though I am logged in?
Login does not work even though credentials are valid.
Social login doesn’t work.
Appending objects to an Array (HTML5 - JS)
New to node.js - need bootstrap to downloadfiles from Kinvey
Problem with Aggregation/Grouping
Internal Server Error using Twitter Sign Up
Data Store
See all 315 topics
yegovik
collection1{
name:{"_type":"KinveyRef","_collection":"collection2","_id":"someId"}
}
collection2{
name:{"_type":"KinveyRef","_collection":"collection3","_id":"someId"}
}
collection3{
name:"coolName"
}
I try to fetch data from collection1 with information from collections 2 and 3. I make request:
var promise = $kinvey.DataStore.find('collection1', null, {relations: { name:"collection2"}});
But in response I have just reference to collection3.
How I can modify my request to get info from collection3? Help me please.