async saveActivities() {
    const iterable = makeArrayAsyncIterable(
      this.getActivityDocs(),
      this.saveActivity,
    );

    let numSaved = 0;
    let totalLaps = 0;
    // eslint-disable-next-line
    for await (const lapsSaved of iterable) {
      numSaved += 1;
      totalLaps += lapsSaved;
    }
    console.log(`${numSaved} activities | ${totalLaps} total laps`);
  }
/**
   * Save documents for validated activities sequentially,
   * which is how Model.create() does it anyway. But we want to
   * catch validation errors one at a time.
   */
Save documents for validated activities sequentially,
which is how Model.create() does it anyway. But we want to
catch validation errors one at a time.
Save documents for validated activities sequentially which is how Model . create () does it anyway . But we want to catch validation errors one at a time .
async saveActivities() {
    const iterable = makeArrayAsyncIterable(
      this.getActivityDocs(),
      this.saveActivity,
    );
    let numSaved = 0;
    let totalLaps = 0;
    for await (const lapsSaved of iterable) {
      numSaved += 1;
      totalLaps += lapsSaved;
    }
    console.log(`${numSaved} activities | ${totalLaps} total laps`);
  }
async saveActivities ( ) { const iterable = makeArrayAsyncIterable ( this . getActivityDocs ( ) , this . saveActivity , ) ; let numSaved = 0 ; let totalLaps = 0 ; for await ( const lapsSaved of iterable ) { numSaved += 1 ; totalLaps += lapsSaved ; } console . log ( ` ${ numSaved } ${ totalLaps } ` ) ; }
Save documents for validated activities sequentially,
 which is how Model.create() does it anyway.
Save documents for validated activities sequentially which is how Model . create () does it anyway .
// eslint-disable-next-line