The reference to the document
Promise to the document or null if not found
Retrieves a document from a collection.
import { get, collection } from 'typesaurus'
type User = { name: string }
const users = collection<User>('users')
get(users, '00sHm46UWKObv2W7XK9e').then(user => {
console.log(user)
//=> { __type__: 'doc', data: { name: 'Sasha' }, ... }
})
// Or using ref:
get(currentUser.ref)
The collection to get document from
The document id
Promise to the document or null if not found
Generated using TypeDoc
Retrieves a document from a collection.
import { get, collection } from 'typesaurus' type User = { name: string } const users = collection<User>('users') get(users, '00sHm46UWKObv2W7XK9e').then(user => { console.log(user) //=> { __type__: 'doc', data: { name: 'Sasha' }, ... } }) // Or using ref: get(currentUser.ref)