GoodDB
    Preparing search index...
    • Remove all values duplicated in a key (array)

      Parameters

      • this: GoodDB
      • key: string

        The key to remove the duplicated values from

      • Optionalvalue: (value: any, index: number, obj: any[]) => any

        The value to remove

      • 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.distinct('key', 'value');
      const db = new GoodDB(new MongoDBDriver({
      uri: "..."
      }));

      await db.connect();

      await db.distinct('key', 'value');