Function createRace

  • Creates a new race.

    Usage

    const race: Omit<Race, "_id"> = {
    name: "The best race ever!",
    instructions: "You will need a controller, so prepare.",
    objectives: "Get 100 starts in the shortest time possible.",
    type: RaceType.TIME,
    startDate: new Date(),
    endDate: new Date(16893846783483),
    downloadLink: "http://masochist.me",
    downloadGrace: "30",
    uploadGrace: "30",
    owner: "738927465878329",
    season: "5eda7778c87dd9a7",
    icon: "http://http.cat/404.jpg",
    };

    const {
    acknowledged,
    insertedId,
    } = await sdk.createRace({ race });

    Parameters

    • params: {
          race: Omit<Race, "_id" | "isActive" | "isDone">;
      }
      • race: Omit<Race, "_id" | "isActive" | "isDone">

        Object with the data of the new race.

    Returns Promise<InsertOneResult<Race>>

Generated using TypeDoc