async saveStats() {
    const {
      locations: topLevelLocations,
      stats: prevStats,
    } = this.athleteDoc;

    this.athleteDoc.set({
      stats_version: 'v2',
      locations: _uniq([
        ...topLevelLocations,
        this.locationName,
      ]),
      stats: {
        ...prevStats,
        locations: {
          ...prevStats.locations,
          [this.locationName]: this.stats,
        },
      },
    });
    this.athleteDoc.markModified('locations');
    this.athleteDoc.markModified('stats');
    await this.athleteDoc.save();
  }
/**
   * Save stats for athleteDoc using v2 format
   * Merges this location's stats back into full stats object
   */
Save stats for athleteDoc using v2 format
Merges this location's stats back into full stats object
Save stats for athleteDoc using v2 format Merges this location ' s stats back into full stats object
async saveStats() {
    const {
      locations: topLevelLocations,
      stats: prevStats,
    } = this.athleteDoc;
    this.athleteDoc.set({
      stats_version: 'v2',
      locations: _uniq([
        ...topLevelLocations,
        this.locationName,
      ]),
      stats: {
        ...prevStats,
        locations: {
          ...prevStats.locations,
          [this.locationName]: this.stats,
        },
      },
    });
    this.athleteDoc.markModified('locations');
    this.athleteDoc.markModified('stats');
    await this.athleteDoc.save();
  }
async saveStats ( ) { const { locations : topLevelLocations , stats : prevStats , } = this . athleteDoc ; this . athleteDoc . set ( { stats_version : 'v2' , locations : _uniq ( [ ... topLevelLocations , this . locationName , ] ) , stats : { ... prevStats , locations : { ... prevStats . locations , [ this . locationName ] : this . stats , } , } , } ) ; this . athleteDoc . markModified ( 'locations' ) ; this . athleteDoc . markModified ( 'stats' ) ; await this . athleteDoc . save ( ) ; }
Save stats for athleteDoc using v2 format
 Merges this location's stats back into full stats object
Save stats for athleteDoc using v2 format Merges this location ' s stats back into full stats object