Amplify JS API Documentation
    Preparing search index...

    Class AsyncCollection<T>

    A collection of related model instances.

    This collection can be async-iterated or turned directly into an array using toArray().

    Type Parameters

    • T

    Implements

    • AsyncIterable<T>
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Turns the collection into an array, up to the amount specified in max param.

      const all = await collection.toArray();
      const first100 = await collection.toArray({max: 100});

      Parameters

      • Optional__namedParameters: { max?: number }

      Returns Promise<T[]>