import { query, limit, order, startAfter, collection } from 'typesaurus'
type Contact = { name: string; year: number }
const contacts = collection<Contact>('contacts')
query(contacts, [
order('year', 'asc', [startAfter(2000)]),
limit(2)
]).then(bornAfter2000 => {
console.log(bornAfter2000)
//=> 420
console.log(bornAfter2000[0].ref.id)
//=> '00sHm46UWKObv2W7XK9e'
console.log(bornAfter2000[0].data)
//=> { name: 'Sasha' }
})
The collection or collection group to query
The query objects
The promise to the query results
Generated using TypeDoc
The query type.