Linked Questions

Popular Questions

How to retrieve angularfire list using a list of keys?

Asked by At

I have a case where I need to join two firebase nodes say 'subset' and 'main' and get the matching values from 'main'. So I tried the below code. It is not working. Please advise.

this.subsetList = this.firebasedb.list('subset', ref => ref.orderByChild('createdOn'));
       this.getSubsetList().subscribe(
            list => {
                this.subsetKeys = list.map(item => {
                    return {
                        $key: item.key
                    };
                })
            }
        );

getSubsetList() {
        return this.commonLiveList.snapshotChanges();
    }

this.mainList = this.subsetKeys.map((key) => this.firebasedb.list(`main/${key}`, ref => ref.orderByChild('CreatedOn')));

Expected Result: Get the list of keys from 'subset' node and get the list from 'main' node using the keys from 'subset'

Related Questions