Properties

clients: {
    [key: string]: NedbClient;
} = {}

An object containing the app's currently-connected database clients. Each key in this object is one client, and the name of each key is the name of that database.

BigfootDS

	let pokemonDatabase = SuperCamo.clientConnect(
"Pokemon Database",
"./Storage",
[
new CollectionListEntry("Users", User),
new CollectionListEntry("CapturedPokemon", Pokemon),
new CollectionListEntry("WildPokemon", Pokemon)
]
);

Accessors

Methods

  • Create a database client instance, connecting to it and returning its instance.

    Parameters

    • databaseName: string

      A unique name for the database.

    • OptionaldatabaseDirectory: string = ""

      The folder path for where the database and its collections will be stored.

    • OptionalcollectionsList: CollectionsListEntry[] = []

      An array of collections, where each item in this array is an object containing the name of the collection and the model or document that the collection will use.

    • OptionalclientType: typeof NedbClient = NedbClient

      A custom type of database client, though you can leave this blank to use the default SuperCamo database client.

    Returns NedbClient

    The newly-created database client instance.

    BigfootDS

  • Disconnect from the specified database AND delete its files. This is extremely destructive! Be careful!

    Parameters

    • targetClient: string

      The name of the database that you wish to disconnect from.

    Returns number

    Number of clients disconnected.

    BigfootDS

  • Disconnect from the specified database.

    Parameters

    • targetClient: string

      The name of the database that you wish to disconnect from.

    Returns number

    Number of clients disconnected.

    BigfootDS

  • Create an accessor for a database that is connected in the app.

    Parameters

    • targetClient: string

      The name of the database that you wish to connect to.

    Returns null | NedbClient

    A NedbClient instance.

    BigfootDS