Skip to content

withConverter doesn't work when used with CollectionReference #2601

@maletor

Description

@maletor

@thebrianchen, it seems types don't work correctly with CollectionReference.

 const posts = await store
  .collection("posts")
  .withConverter({ toFirestore, fromFirestore })
  .get();

posts.forEach(doSomething);

The forEach callback takes a QueryDocumentSnapshot (not a DocumentSnapshot) and there's no way to get the T on that object. It's only on DocumentSnapshot.

Is this by design, can we fix this

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions