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

Hi Borna- I wanted to point you to the Relational Data documentation and see if that helps answer your question:
Unfortunately that doesn't help me, because there is only described how User entity can be another object's property.
Can you give me a better idea of what the use case is? That will help me answer more fully.
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.

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.
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.
Thanks for the help Edward but I'm using iOS framework
I tagged with iOS as well.
Login or Signup to post a comment