GoodDB
    Preparing search index...
    • Set a value to a key

      Parameters

      • this: GoodDB
      • key: string

        The key to set the value to

      • value: any

        The value to set

      • Optionaloptions: methodOptions

        The options to use

      Returns boolean | Promise<boolean>

      A promise if the driver is async, otherwise a boolean

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