Hi Borna- I wanted to point you to the Relational Data documentation and see if that helps answer your question: http://devcenter.kinvey.com/guides/datastore#RelationalData
B
Borna Beaković
said
about 7 years ago
Unfortunately that doesn't help me, because there is only described how User entity can be another object's property.
C
Caroline
said
about 7 years ago
Can you give me a better idea of what the use case is? That will help me answer more fully.
B
Borna Beaković
said
about 7 years ago
So for example, we have a Events collection with multiple events that users can join. And I want to persist events that users joins on his entity, on his account, is that possible? Sorry if I am not clear enough.
I
ItsLeeOwen
said
about 7 years ago
We've been adding relational data to users in Node.js. It seems to work, however I don't believe that the related data is included in the result of Kinvey.getActiveUser(). We can see that the relationships exist in the user panel.
https://www.dropbox.com/s/y8kxes5tgi54lwn/107.jpg
E
Edward
said
about 7 years ago
Hey, just to confirm-- are you using the Android library?
If so, yes, this is possible:
You can set a KinveyReference on the user object my doing something like this:
myClient.user().put("myReferenceFieldName", new KinveyReference("myCollectionToReference", "myObjectIDToReference"));
And then, you can resolve that reference by calling:
myClient.user().retrieve(new String[]{"myReferenceFieldName"}, new KinveyUserCallback() { ... });
The User object returned in that `KinveyUserCallback` will contained the resolved reference.
B
Borna Beaković
said
about 7 years ago
Thanks for the help Edward but I'm using iOS framework
Borna Beaković