WRDEntityMatch | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Type Alias WRDEntityMatch<Schema, TypeName>

    WRDEntityMatch:
        | number
        | MatchObjectQueryable<EntityMatchSchema<Schema>[TypeName]>

    Select an entity by its numeric wrdId or by an object of field-value pairs matched using equality. Used by APIs such as update and getFields; the consuming API determines how many matching entities are allowed.

    Type Parameters

    • Schema extends keyof WRDSchemaLike | AnyWRDSchema

      A schema name registered in WRDSchemaLike, or a schema object type such as typeof usermgmtSchema.

    • TypeName extends keyof EntityMatchSchema<Schema> & string

      An entity type tag in the selected schema.

    const usermgmtSchema = wrd("system:usermgmt");
    const byTag: WRDEntityMatch<typeof usermgmtSchema, "wrdPerson"> = { wrdTag: "SYSOP" };
    await usermgmtSchema.getFields("wrdPerson", byTag, ["wrdFirstName", "wrdLastName"]);