Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Functions

Type aliases

FirebaseQuery

FirebaseQuery: CollectionReference | Query

Query

Query<Model, Key>: OrderQuery<Model, Key> | WhereQuery<Model> | LimitQuery

The query type.

Type parameters

  • Model

  • Key: keyof Model

Functions

query

  • Queries passed collection using query objects (order, where, limit).

    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' }
    })

    Type parameters

    • Model

    Parameters

    • collection: Collection<Model> | CollectionGroup<Model>

      The collection or collection group to query

    • queries: Query<Model, keyof Model>[]

      The query objects

    Returns Promise<Doc<Model>[]>

    The promise to the query results

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc