Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Store

The alias for Collection. Better representing the root collection.

Hierarchy

Index

Constructors

  • new Store(loc: string, ext?: string): Store
  • Parameters

    • loc: string

      The location of the directory.

    • ext: string = ".json"

      The extension of the data files in the directory.

    Returns Store

Properties

c: (name: string) => Collection = ...

Type declaration

    • The alias for collection.

      Parameters

      • name: string

        The name of the sub collection.

      Returns Collection

      Sub collection instance.

d: (name: string) => Document = ...

Type declaration

    • The alias for document.

      Parameters

      • name: string

        The name of the document.

      Returns Document

      Document instance.

dir: (name: string) => Collection = ...

Type declaration

    • The alias for collection.

      Parameters

      • name: string

        The name of the sub collection.

      Returns Collection

      Sub collection instance.

doc: (name: string) => Document = ...

Type declaration

    • The alias for document.

      Parameters

      • name: string

        The name of the document.

      Returns Document

      Document instance.

docs: (matcher?: RegExp) => Document[] = ...

Type declaration

    • List all the documents in the collection.

      Parameters

      • matcher: RegExp = ...

        A regular expression to match against the document name. (without extension)

      Returns Document[]

      The list of documents in the collection.

ext: string = ".json"
loc: string
subs: (matcher?: RegExp) => Collection[] = ...

Type declaration

    • List all the sub collections in the collection.

      Parameters

      • matcher: RegExp = ...

        A regular expression to match against the collection name.

      Returns Collection[]

      The list of collections in the collection.

Accessors

  • get name(): string
  • Get the name of the collection.

    Returns string

  • get size(): number
  • Get the size of the collection in bytes.

    Returns number

Methods

  • List all the sub collections in the collection.

    Parameters

    • matcher: RegExp = ...

      A regular expression to match against the collection name.

    Returns Collection[]

    The list of collections in the collection.

  • delete(): void
  • List all the documents in the collection.

    Parameters

    • matcher: RegExp = ...

      A regular expression to match against the document name. (without extension)

    Returns Document[]

    The list of documents in the collection.

Generated using TypeDoc