Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Functions

remove

  • remove<Model>(collection: Collection<Model>, id: string): Promise<void>
  • remove<Model>(ref: Ref<Model>): Promise<void>
  • Removes a document.

    import { remove } from 'typesaurus'
    
    type User = { name: string }
    const users = collection<User>('users')
    
    remove(users, '00sHm46UWKObv2W7XK9e').then(() => console.log('Done!'))

    Type parameters

    • Model

    Parameters

    • collection: Collection<Model>

      The collection to remove document in

    • id: string

      The id of the documented to remove

    Returns Promise<void>

    A promise that resolves when the operation is complete

  • Removes a document.

    import { remove } from 'typesaurus'
    
    type User = { name: string }
    const users = collection<User>('users')
    
    remove(users, '00sHm46UWKObv2W7XK9e').then(() => console.log('Done!'))

    Type parameters

    • Model

    Parameters

    • ref: Ref<Model>

      The reference to the document to remove

    Returns Promise<void>

    A promise that resolves when the operation is complete

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