Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

346
Views
¿Cómo consulto una colección con el nuevo cambio en @ angular/fire versión 7.2.0?

Me gustaría consultar la colección de elementos filtrando solo los documentos que tienen una identificación determinada.

 import { Firestore, collectionData, collection } from '@angular/fire/firestore'; import { Observable } from 'rxjs'; interface Item { name: string, ... }; @Component({ selector: 'app-root', template: ` <ul> <li *ngFor="let item of item$ | async"> {{ item.name }} </li> </ul> ` }) export class AppComponent { item$: Observable<Item[]>; constructor(firestore: Firestore) { const collection = collection(firestore, 'items'); this.item$ = collectionData(collection); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Logro consultar siguiendo los siguientes pasos

 // Import statement import { Firestore, collectionData, collection,where,query } from '@angular/fire/firestore'; // Please define an Observable like below Items: Observable<Item[]>; // Item being a model // inside your function const appRef = collection(this.firestore, 'items') const appQuery = query(appRef, where('uid', '==', userId)); this.Items= (await collectionData(appQuery)).pipe( map((actions) => { return actions.map((a) => { const data = a as Item; const uid = a.id; return { uid, ...data }; }); }) );
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!