GoodDB
    Preparing search index...
    • Subtract a value from a key

      Parameters

      • this: GoodDB
      • key: string

        The key to subtract the value from

      • value: number

        The value to subtract

      • Optionaloptions: methodOptions

        The options to use

      Returns number | Promise<number>

      A promise if the driver is async, otherwise a number

      const db = new GoodDB(new JSONDriver({
      path: './database.json'
      }));
      db.subtract('key', 1);
      const db = new GoodDB(new MongoDBDriver({
      uri: "..."
      }));
      await db.connect();
      await db.subtract('key', 1);