// events_tracking use events_tracking db.activityApprovals.createIndex( { eventId: 1, registrationOptionId: 1, riderId: 1, activityId: 1}, { unique: true } ); db.scorecards.createIndex( { eventId: 1, registrationOptionId: 1, riderId: 1}, { unique: true } ); db.controlMarkings.createIndex( { eventId: 1, registrationOptionId: 1, controlId: 1, riderId: 1}, { unique: true } ); db.registrationOptions.createIndex({eventId: 1, registrationOptionId}, {unque: true}) // activities db use activities db.activities.createIndex( { externalActivityId: 1, externalSourceName: 1}, { unique: true } ); db.activities.createIndex( { riderId: 1, startTimestamp: -1}, { unique: false } ); db.riderSummary.createIndex( { riderId: 1 }, { unique: true } ); db.riderYearlySummary.createIndex( { riderId: 1, year: 1 }, { unique: true } ); db.riderMonthlySummary.createIndex( { riderId: 1, year: 1, month: 1 }, { unique: true } ); // riders db use riders db.stravariders.createIndex( { riderId: 1 }, { unique: true } ); db.stravariders.createIndex( { stravaAthleteId: 1 }, { unique: true } );