Function updateRaceById

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

    Updatable fields

    • name
    • instructions
    • objectives
    • startDate
    • endDate
    • downloadLink
    • downloadGrace
    • uploadGrace
    • icon
    • isActive
    • isDone

    Usage

    const raceId: string = "5f5e555d5a578b6";
    const race: Partial<Race> = {
    downloadLink: "http://http.cat/201.jpg",
    };

    const {
    acknowledged,
    matchedCount,
    modifiedCount,
    upsertedCount,
    upsertedId,
    } = await sdk.updateRaceById({ raceId, race });

    Parameters

    • params: {
          raceId: string;
          race: Partial<Omit<Race, "_id">>;
      }
      • raceId: string

        ID of the race to update.

      • race: Partial<Omit<Race, "_id">>

        Fields to update in the chosen race.

    Returns Promise<UpdateResult>

Generated using TypeDoc