question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do i query a collection with the new change that have been made?

See original GitHub issue

How do query a firestore collection to find document that meet a certain condition? please find an example of the code below.

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);
  }
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:9

github_iconTop GitHub Comments

1reaction
pazdernikpavelcommented, May 27, 2022

Thank you guys for helping me with the new query syntax. Still can not believe it is not part of official documentation for such a long time…

1reaction
dsl400commented, Jan 21, 2022

how do we combine multiple where clauses in this mode ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

db.collection.update() — MongoDB Manual
Syntax. Changed in version 5.0. The db.collection.update() method has the following form: ... Creates a new document if no documents match the query...
Read more >
Create collections - Configuration Manager - Microsoft Learn
Include collection rule ... Include the members of another collection in a Configuration Manager collection. If the included collection changes, ...
Read more >
Clone a query collection - OCLC Support
From the Collection Actions drop-down, select Clone Collection. A new collection is generated with the information from the original collection.
Read more >
Does Firestore collection query get updates to all objects in ...
Now if a new document is created in the collection, or a document is removed, the onSnapshot callback will be re-invoked with those...
Read more >
Data-modification queries | AQL | ArangoDB Documentation
Note that both collections must already exist when the query is executed. The query might fail if backup already contains documents, as executing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found