GoodDB
    Preparing search index...
    • Set multiple key-value pairs at once

      Parameters

      • this: GoodDB
      • data: Record<string, any>

        An object with key-value pairs 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.setMany({ key1: 'value1', key2: 'value2' });
      const db = new GoodDB(new MongoDBDriver({
      uri: "..."
      }));
      await db.connect();
      await db.setMany({ key1: 'value1', key2: 'value2' });