Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AngularFirestoreCollection get function returns non generic QuerySnapshot #2438

Closed
batchi92 opened this issue Apr 30, 2020 · 1 comment
Closed

Comments

@batchi92
Copy link

Version info

Angular: 8.2.14

Firebase: 7.14.2

AngularFire: 5.4.2

Ionic: 5.0.7

Capacitor: 2.0.1

How to reproduce these conditions

let users: Array<{ username: string }>

this.fireStore.collection<{ username: string }>('users').get().subscribe(querySnapshot => {
users = querySnapshot.docs.map(doc => doc.data())
})

Debug output

Type 'DocumentData[]' is not assignable to type '{ username: string; }[]'.
Property 'username' is missing in type 'DocumentData' but required in type '{ username: string; }'.

Expected behavior

The QueryDocumentSnapshot's data() functions return value should be of the type '{ username: string; }'

Actual behavior

Its return value is of the type DocumentData

@jamesdaniels
Copy link
Member

Should be addressed in 6.1.0-rc.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants