I'm trying to fetch some data from firebase. In my object, I have
Recent
|_UniversitId
|_objectiId1
| |_ userId:1
| |_ timestamp:143242344
|_objectiId2
|_ userId:1
|_ timestamp:143243222
My querying path is http://firbasedbname.com/Recent/UniversityId
. I need to fetch the entries which are userId id is equal to 1 and order that set by timestamp. I tried the following,
FIRDatabaseQuery *query = [[firebase queryOrderedByChild:@"userId"] queryEqualToValue:@"1"];
This fetches my the users correctly. But is there a possible way to order this set by timestamp. To do that I tried by putting another queryOrderedByChild
. But it says it can be used only one time. How may I fix this?