Skip to main content

Class: MatchMaker

Represents a matchmaker. You can insert entities into the matchmaker and find matches for them.

Properties

id

Readonly id: string

Methods

delete

delete(): Promise<void>

Returns

Promise<void>


deleteEntity

deleteEntity(entityId): Promise<void>

Parameters

NameType
entityIdstring

Returns

Promise<void>


findMatches

findMatches(entityId, options?): Promise<MmEntityMatch[]>

Finds matches for the given entity id.

Parameters

NameType
entityIdstring
optionsMmFindMatchesOptions

Returns

Promise<MmEntityMatch[]>


findMatchesForEntity

findMatchesForEntity(entity, options?): Promise<MmEntityMatch[]>

Finds matches for the given entity.

Parameters

NameType
entityOmit<MmEntity, "metadata" | "id">
optionsMmFindMatchesOptions

Returns

Promise<MmEntityMatch[]>


getEntity

getEntity(entityId): Promise<undefined | MmEntity>

Returns the entity with the given ID.

Parameters

NameType
entityIdstring

Returns

Promise<undefined | MmEntity>


getMatchMakerDetails

getMatchMakerDetails(): MmMatchMaker

Returns an object with the matchmaker details.

Returns

MmMatchMaker


insertEntity

insertEntity(entity): Promise<void>

Adds a new entity to the matchmaker - replaces existing entity with the same ID if exists.

Parameters

NameType
entityMmEntity

Returns

Promise<void>


insertManyEntities

insertManyEntities(entities): Promise<void>

Adds a new entities to the matchmaker - replaces existing entities with the same ID if exists. This method is more efficient than calling insertEntity multiple times.

Parameters

NameType
entitiesMmEntity[]

Returns

Promise<void>


listEntities

listEntities(categoryId, options?): Promise<MmEntity[]>

Lists entities in the matchmaker that match the given category ID and the provided options. The results are ordered by the entity id.

Parameters

NameType
categoryIdstring
optionsMmListEntitiesOptions

Returns

Promise<MmEntity[]>