Ends the query results on the given value.
import { endAt, order, query, collection } from 'typesaurus'
type Contact = { name: string; year: number }
const contacts = collection<Contact>('contacts')
query(contacts, [order('year', 'asc', [endAt(1999)])])
.then(olderThan2K => {
console.log(olderThan2K.length)
//=> 420
})
The value to end the query results at
The cursor object
Ends the query results before the given value.
import { endBefore, order, query, collection } from 'typesaurus'
type Contact = { name: string; year: number }
const contacts = collection<Contact>('contacts')
query(contacts, [order('year', 'asc', [endBefore(2000)])])
.then(olderThan2K => {
console.log(olderThan2K.length)
//=> 420
})
The value to end the query results before
The cursor object
Start the query results after the given value.
import { startAfter, order, query, collection } from 'typesaurus'
type Contact = { name: string; year: number }
const contacts = collection<Contact>('contacts')
query(contacts, [order('year', 'asc', [startAfter(1999)])])
.then(youngerThan2K => {
console.log(youngerThan2K.length)
//=> 420
})
The value to end the query results after
The cursor object
Start the query results on the given value.
import { startAt, order, query, collection } from 'typesaurus'
type Contact = { name: string; year: number }
const contacts = collection<Contact>('contacts')
query(contacts, [order('year', 'asc', [startAt(2000)])])
.then(youngerThan2K => {
console.log(youngerThan2K.length)
//=> 420
})
The value to start the query results at
The cursor object
Generated using TypeDoc
Available cursor methods.