Function updateBadgeById

  • Updates a badge by given ID.

    Badge is identified by its stringified ObjectID.

    Updatable fields

    • name
    • description
    • points
    • requirements
    • image

    Usage

    const badgeId: string = "5f5e555d5a578b6";
    const badge: Partial<Badge> = {
    points: 10,
    };

    const {
    acknowledged,
    matchedCount,
    modifiedCount,
    upsertedCount,
    upsertedId,
    } = await sdk.updateBadgeById({ badgeId, badge });

    Parameters

    • params: {
          badgeId: string;
          badge: Partial<Omit<Badge, "_id">>;
      }
      • badgeId: string

        ID of the badge to update.

      • badge: Partial<Omit<Badge, "_id">>

        Fields to update in the badge of given ID.

    Returns Promise<UpdateResult>

Generated using TypeDoc