[SOLVED] Getting incorrect data for one field in template

I have a table I’m creating in the UI

<table class="striped">
                <thead>
                    <tr>
                        <th>Weight</th>
                        <th>Sets</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>{{prevWorkout.exerciseWeight}}</td>
                        <td>
                            <table>
                                <thead>
                                    <tr>
                                        <th>Set #</th>
                                        <th>Reps</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {{#each prevWorkout.sets}}
                                    <tr>
                                        <td>{{setNo}}</td>
                                        <td>{{repCount}}</td>
                                    </tr>
                                    {{/each}}
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>

I am returning the data from this query:

    prevWorkout: async() => {
        let exerciseName = Session.get("exerciseName");
        return await LogEntry.findOneAsync({ exerciseName: exerciseName }, { sort: { _id: -1 } });
    },

The data

{
    _id: 'H67YisBZoRdCA9bsj',
    exerciseId: 'phpiPXqB3gJbh5X7v',
    exerciseName: 'Inclined Press',
    exerciseWeight: 80,
    dateAdded: '2026-02-17',
    timeAdded: '08:02:SS',
    addedBy: 'SGYvKLA3wipMbdNnZ',
    sets: [
      { setNo: 1, repCount: 10 },
      { setNo: 2, repCount: 10 },
      { setNo: 3, repCount: 9 }
    ]
  },

I get thte correct weight, and in the subdocument I get the correct repCount, but for some reason I only get 0 when setNo is displayed for every setNo value.

Any help is much appreciated on figuring out why this one field doesn’t display the correct data.
wrong-data-in-table

Solved it. Oddly, it appears that because I was using setNo as my key, it was causing some issues with differentiating between @index and the key, so it failed back to the index value of 0. Not sure wy, but AI chat to the rescue on this.