Retrieves a document from Firestore based on the provided document reference.
import { firestore } from 'firebase-admin'import * as admin from 'firebase-admin'import { get } from '@skeet-framework/firestore'const db = admin.firestore();async function run() { try { const db = admin.firestore(); const path = 'Users' const id = 'user123' const user = await get<User>(db, path, id) console.log(`Retrieved user: ${user.name}, age: ${user.age}`) } catch (error) { console.error(`Error retrieving document: ${error}`) }}run(); Copy
import { firestore } from 'firebase-admin'import * as admin from 'firebase-admin'import { get } from '@skeet-framework/firestore'const db = admin.firestore();async function run() { try { const db = admin.firestore(); const path = 'Users' const id = 'user123' const user = await get<User>(db, path, id) console.log(`Retrieved user: ${user.name}, age: ${user.age}`) } catch (error) { console.error(`Error retrieving document: ${error}`) }}run();
The data of the document as an object of type T or null if the document does not exist.
Generated using TypeDoc
Retrieves a document from Firestore based on the provided document reference.
Example