ios - Firebase inconsistent data structure -
i assessing firebase replacement parse in current app. have come across issue when querying remote data.
when retrieve query getting inconsistent data structure back.
my realtime data looks this:
previously in parse bool values set 'beef, chicken, pork' have been held in array , query based on array containing item each row. firebase advises arrays bad in json have had implement them bool's , query based on property, query looks this
firdatabasereference *ref = [[firdatabase database] reference]; firdatabasereference *path = [ref child:@"recipes"]; firdatabasequery *query1 = [path queryorderedbychild:@"beef"]; firdatabasequery *query2 = [query1 queryequaltovalue:[nsnumber numberwithbool:yes]]; [query2 observesingleeventoftype:firdataeventtypevalue withblock:^(firdatasnapshot * _nonnull snapshot) { [self hidespinner]; nsarray *recipes = (nsarray *)snapshot.value;
the initial query works fine , data comes follows
however, if amend query :
[path queryorderedbychild:@"pork"];
the data structure different,
yet comes same json previous entry - has experienced similar? driving me nuts
Comments
Post a Comment