How to get RealmObject assigned to my partition

Hello guys, I’ve just started develop a game with Synced Realm SDK in Unity. I’ve a noob question:
I’ve created a single object called Player with assigned owner_id (partition field) to User Id. This object has also automatically generated _id. What is the best solution to retrive this object next time when the User logged in?
As I understand the User should only get their partition data. Should I use the Find method or something else?

Your sincerely

If you know the _id, you can definitely use Find. Alternatively, you can just get a collection containing all Player objects and get the first (and as far as I understand, only) element by calling realm.All<Player>().First()

1 Like

Thanks, okay then, I’ll be creating Player _id as a User Id and retreiving it by Find.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.