Sets a document to the given data.
import { set, get, collection } from 'typesaurus'
type User = { name: string }
const users = collection<User>('users')
const userId = '00sHm46UWKObv2W7XK9e'
await set(users, userId, { name: 'Sasha Koss' })
console.log(await get(users, userId))
//=> { name: 'Sasha Koss' }
Sets a document to the given data.
import { set, get, collection } from 'typesaurus'
type User = { name: string }
const users = collection<User>('users')
const userId = '00sHm46UWKObv2W7XK9e'
await set(users, userId, { name: 'Sasha Koss' })
console.log(await get(users, userId))
//=> { name: 'Sasha Koss' }
the collection to set document in
the id of the document to set
the document data
Generated using TypeDoc
Type of the data passed to the set function. It extends the model allowing to set server date field value.