Function updateRaceByParticipantId

  • Updates a race participant by given ID (if it exists).

    Race is identified by its stringified ObjectID. Participant is identified by their Discord ID.

    Updatable fields

    • startDate
    • endDate
    • dnf

    Usage

    const raceId: string = "5f5e555d5a578b6";
    const memberId: string = "9674893087456";
    const update: Partial<RacePlayer> = { dnf: true };

    const {
    acknowledged,
    matchedCount,
    modifiedCount,
    upsertedCount,
    upsertedId,
    } = await sdk.updateRaceByParticipantId({ raceId, memberId, update });

    Parameters

    • params: {
          raceId: string;
          memberId: string;
          update: Partial<Omit<RacePlayerScore | RacePlayerTime, "_id" | "type">>;
      }
      • raceId: string

        ID of the race in which requested user participates.

      • memberId: string

        Discord ID of the race participant to be updated.

      • update: Partial<Omit<RacePlayerScore | RacePlayerTime, "_id" | "type">>

        Fields that need to be changed.

    Returns Promise<UpdateResult>

Generated using TypeDoc