Type of the data passed to the set function. It extends the model allowing to set server date field value.
Adds a new document with a random id to a collection.
import { add, collection } from 'typesaurus' type User = { name: string } const users = collection<User>('users') const user = await add(users, { name: 'Sasha' }) console.log(user.id) //=> '00sHm46UWKObv2W7XK9e'
The collection to add to
The data to add to
A promise to the ref
Generated using TypeDoc
Type of the data passed to the set function. It extends the model allowing to set server date field value.