Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

untypedWhereArrayContains

  • untypedWhereArrayContains<Model>(field: string | string[], value: any): WhereQuery<Model>
  • Creates where query with array-contains filter operation.

    import { untypedWhereArrayContains, query, collection } from 'typesaurus'
    
    type User = {
      name: string,
      interests: string[]
    }
    
    const users = collection<User>('users')
    
    query(users, [untypedWhereArrayContains('interests', 'snowboarding'])
      .then(snowborders => {
        console.log(snowboarders.length)
        //=> 42
      })

    Type parameters

    • Model

    Parameters

    • field: string | string[]

      The field or key path to query

    • value: any

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

where

  • where<Model, Key>(field: Key | [Key], filter: FirestoreWhereFilterOp, value: Model[Key]): WhereQuery<Model>
  • where<Model, Key1, Key2>(field: [Key1, Key2], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3>(field: [Key1, Key2, Key3], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4>(field: [Key1, Key2, Key3, Key4], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4, Key5>(field: [Key1, Key2, Key3, Key4, Key5], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4][Key5]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4, Key5, Key6>(field: [Key1, Key2, Key3, Key4, Key5, Key6], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4][Key5][Key6]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4, Key5, Key6, Key7>(field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8>(field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9>(field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8][Key9]): WhereQuery<Model>
  • where<Model, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10>(field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10], filter: FirestoreWhereFilterOp, value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8][Key9][Key10]): WhereQuery<Model>
  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key: keyof Model

    Parameters

    • field: Key | [Key]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    Parameters

    • field: [Key1, Key2]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    Parameters

    • field: [Key1, Key2, Key3]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    Parameters

    • field: [Key1, Key2, Key3, Key4]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    • Key5: keyof Model[Key1][Key2][Key3][Key4]

    Parameters

    • field: [Key1, Key2, Key3, Key4, Key5]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4][Key5]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    • Key5: keyof Model[Key1][Key2][Key3][Key4]

    • Key6: keyof Model[Key1][Key2][Key3][Key4][Key5]

    Parameters

    • field: [Key1, Key2, Key3, Key4, Key5, Key6]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4][Key5][Key6]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    • Key5: keyof Model[Key1][Key2][Key3][Key4]

    • Key6: keyof Model[Key1][Key2][Key3][Key4][Key5]

    • Key7: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6]

    Parameters

    • field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    • Key5: keyof Model[Key1][Key2][Key3][Key4]

    • Key6: keyof Model[Key1][Key2][Key3][Key4][Key5]

    • Key7: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6]

    • Key8: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7]

    Parameters

    • field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    • Key5: keyof Model[Key1][Key2][Key3][Key4]

    • Key6: keyof Model[Key1][Key2][Key3][Key4][Key5]

    • Key7: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6]

    • Key8: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7]

    • Key9: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8]

    Parameters

    • field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8][Key9]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

  • Creates where query.

    import { where, ref, query, collection, Ref } from 'typesaurus'
    
    type User = { name: string }
    type Order = { user: Ref<User>, item: string }
    const users = collection<User>('users')
    const orders = collection<User>('orders')
    
    query(orders, [where('user', '==', ref(users, '00sHm46UWKObv2W7XK9e')])
      .then(userOrders => {
        console.log(userOrders.length)
        //=> 42
      })
    // Or using key paths:
    query(orders, [where(['address', 'city'], '==', 'Moscow'])

    Type parameters

    • Model

    • Key1: keyof Model

    • Key2: keyof Model[Key1]

    • Key3: keyof Model[Key1][Key2]

    • Key4: keyof Model[Key1][Key2][Key3]

    • Key5: keyof Model[Key1][Key2][Key3][Key4]

    • Key6: keyof Model[Key1][Key2][Key3][Key4][Key5]

    • Key7: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6]

    • Key8: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7]

    • Key9: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8]

    • Key10: keyof Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8][Key9]

    Parameters

    • field: [Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10]

      The field or key path to query

    • filter: FirestoreWhereFilterOp

      The filter operation ('<', '<=', '==', '>=' or '>')

    • value: Model[Key1][Key2][Key3][Key4][Key5][Key6][Key7][Key8][Key9][Key10]

      The value to pass to the operation

    Returns WhereQuery<Model>

    The where query object

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