Question

I've created a number of users in Parse. There're Facebook users and non-Facebook user. For each Facebook user I've saved an extra column of "facebookID".

Now I'd like to get all the ParseUsers that are Facebook Users. So I applied a Task to query the users with "facebookID" in them.

var Task = ParseUser.Query.WhereExists("facebookID").FindAsync().ContinueWith(t=>{

        if (t.IsFaulted || t.IsCanceled) {
            Debug.Log ("t.Exception=" + t.Exception);
            //cannot load friendlist
            return;
        }
        else{
            fbFriends = t.Result;

            foreach(var result in fbFriends){
                string id = (string)result["facebookID"];

                //facebookUserIDList is a List<string>
                facebookUserIDList.Add(id);
            }

            return;
        }
    });

The above code works perfectly. However, I'd like to get more data from each Facebook User, for example, the current_coins that the user has. So I change the foreach loop to:

foreach(var result in fbFriends){
    string id = (string)result["facebookID"];
    int coins = (int)result["current_coins"];
    //facebookUserIDList is a List<string>
    facebookUserIDList.Add(id);
}

I've changed the facebookUserIDList into a List<Dictionary<string,object>> instead of a List<string> in order to save the other data as well. But the foreach loop does not run at all. Does it mean I can only get the facebookID from it because I specified WhereExists("facebookID") in FindAsync()? Can anybody explain it to me please?

Thank you very much in advance.

Was it helpful?

Solution

it should contain all Parse primitive data type(such as Boolean, Number, String, Date...) for each Object. but not Pointers nor Relation.

for Pointers, you can explicitly include them in the result using the "Include" method

for any ParseRelation you have to requery them

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top