Start a new topic

User Class saving relation

Is it possible to save a relation to entity from another class to user class? Thank you

Yes. http://devcenter.kinvey.com/ios/guides/datastore#userrelationships
I tagged with iOS as well.
Thanks for the help Edward but I'm using iOS framework
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.
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
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.

Can you give me a better idea of what the use case is? That will help me answer more fully.
Unfortunately that doesn't help me, because there is only described how User entity can be another object's property.
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
Login or Signup to post a comment