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

      Parameters

      • this: GoodDB
      • key: string

        The key to unshift the value to

      • value: any

        The value to unshift

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