Operating System
any
Browser Version
any
Firebase SDK Version
10.1.0
Firebase SDK Product:
Firestore
Describe your project's tooling
Using typescript:
import {
CollectionReference,
DocumentData,
collection,
getFirestore,
} from 'firebase/firestore';
const firestore = getFirestore({...});
export const getCollectionRef = <T = DocumentData>(collectionName: string) => {
return collection(firestore, collectionName) as CollectionReference<T>;
};
Describe the problem
Typescript definitions do not provide a way to access the snapshot._document.createTime property.
Steps and code to reproduce issue
getDocs(collection(firestore, 'users') as CollectionReference<{foo: string}>).then(snapshots => {
// @ts-expect-error missing typescript definition
snapshots.docs[0]._document.createTime;
})
but the _document is defined:
