Answers for "orderBy firebase angular"

0

orderBy firebase angular

import { map, take } from 'rxjs/operators';
import { Observable } from 'rxjs';

public allProducts: Observable<any[]>;
 public amazonCollection: AngularFirestoreCollection;  

this.amazonCollection = this.afs.collection('amazon', (ref) =>
      ref.orderBy('voteCount')
    );
    this.allProducts = this.amazonCollection.snapshotChanges().pipe(
      map((actions) => {
        return actions.map((a) => {
          return { id: a.payload.doc.id, ...a.payload.doc.data() };
        });
      })
    );
Posted by: Guest on December-19-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language