0

I m working on parse. There are 2 table:
1. ScoreNode: User, score.
2. User: id, name, image(ParseFile)

Now need a query to fetch all the these info in one go.

ParseQuery<ScoreNode> query = new ParseQuery<ScoreNode>();
query.include("user");

How i can include image file?
query.include("user.image");

And query should be on scorenode.

4
  • To be honest I think you need to define a piece of Cloud Code for this query using the masterkey. As I recall you are not allowed to query Users directly from Android, not 100% sure though. Commented Jun 6, 2014 at 12:36
  • If so, you could also refactor the database to include a UserData[User,name,image,rel(ScoreNode)] object, which you indeed are free to query. The relation could simplify the query for presenting the users own scores and is just an optional addition. Commented Jun 6, 2014 at 12:49
  • But a user can have multiple ScoreNode then how can i create multiple column at run time.... Commented Jun 6, 2014 at 14:58
  • As long as all User pointers in ScoreNode points to the same user, then you can query for all ScoreNodes owned by that User. If that is what you are asking? Commented Jun 6, 2014 at 15:03

1 Answer 1

0

regarding "scorenode.user"

if that is type pointer -> User object

and User has the image field

Then you should be able to get everything but the image in one query by tagging on '?include=User' to the query on scorenode.

In Rest api its just a parm '?include= $pointer'

dont know syntax in android SDK.

A 2nd call will be needed to get the bitmap image itself. I think you can get the image URL from the first query and then just use that url getting a bitmap.

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.