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:

enter image description here enter image description here

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

enter image description here

however, if amend query :

[path queryorderedbychild:@"pork"]; 

the data structure different,

enter image description here

yet comes same json previous entry - has experienced similar? driving me nuts


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -