I am trying to get a firestore collection in Unity by following this link, but it gives me an error:
'Task' does not contain a definition for 'Documents' and no accessible extension method 'Documents' accepting a first argument of type 'Task'.
My Code:
CollectionReference allCitiesQuery = db.Collection("MyList");
Task<QuerySnapshot> allCitiesQuerySnapshot = allCitiesQuery.GetSnapshotAsync();
foreach (DocumentSnapshot documentSnapshot in allCitiesQuerySnapshot.Documents)
{
Dictionary<string, object> city = documentSnapshot.ToDictionary();
foreach (KeyValuePair<string, object> pair in city)
{
Debug.Log(pair.Key + " " + pair.Value);
//Console.WriteLine("{0}: {1}", pair.Key, pair.Value);
}
}
}
I have read the documentation but there is very little focus on Unity because a few days ago it was just implemented. Can anyone help me here, please?