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