Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "index"

Index

Variables

Let db

db: any

Let dbCreated

dbCreated: boolean = false

Functions

Const createDatabase

  • createDatabase(name: string): void
  • Creates a new PouchDB instance

    Parameters

    • name: string

      is the name of the database

    Returns void

Const getAllDocuments

  • getAllDocuments(): Promise<object[]>
  • Gets all documents out of the database

    Returns Promise<object[]>

    Array of document objects

Const getDocById

  • getDocById(id: any): Promise<object>
  • Returns the document of a specified id

    Parameters

    • id: any

      the id of document

    Returns Promise<object>

    The document being returned

Const saveDocument

  • saveDocument(doc: object): void
  • Saves a new document to the database

    Parameters

    • doc: object

      is the document object being saved to the database

    Returns void

Const updateDocument

  • updateDocument(doc: any, key: any, value: any): Promise<void>
  • Updates a document that already exists in the database

    Parameters

    • doc: any

      is the document that needs to be updated

    • key: any

      is the object property we would like to update

    • value: any

      is the value of the new property being updated

    Returns Promise<void>

Generated using TypeDoc