@wxn0brp/db-core
    Preparing search index...

    Class Collection<D>

    Type Parameters

    Index

    Constructors

    Properties

    collection: string

    Methods

    • Add data to a database.

      Parameters

      • data: Arg<D>
      • id_gen: false

      Returns Promise<D>

    • Add data to a database.

      Parameters

      • data: Arg<D>
      • Optionalid_gen: true

      Returns Promise<D & { _id: string }>

    • Asynchronously removes one entry in a database or adds a new one if it doesn't exist. Usage e.g. for toggling a flag. Returns a promise resolving to false if the entry was found and removed, or true if the entry was added. The returned value reflects the state of the database after the operation.

      Parameters

      Returns Promise<ToggleOneResult<D>>