0

Normally when querying for an object with a pointer I use query.includeKey("String"), to be able to access the information that its pointing to in that class.

Recently I needed to access a value from a pointer that was pointed to by another pointer. For example: I have a class in which all likes of a post go to. When a person likes a post I use a pointer to reference the specific post from the Post class which was liked. In my posts class I use a pointer to reference the User class of the user who posted that post. I want to know how I can access that user information from the like class. What I did was I used query.includeKey("posts") and then when I try to access say the users picture from the user object I get a crash.

1 Answer 1

1

You can use includeKey for multi-level queries:

// Assuming author is the key name in Posts
query.includeKey("posts.author")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.