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
Name | Type |
---|---|
entityId | string |
Returns
Promise
<void
>
findMatches
▸ findMatches(entityId
, options?
): Promise
<MmEntityMatch
[]>
Finds matches for the given entity id.
Parameters
Name | Type |
---|---|
entityId | string |
options | MmFindMatchesOptions |
Returns
Promise
<MmEntityMatch
[]>
findMatchesForEntity
▸ findMatchesForEntity(entity
, options?
): Promise
<MmEntityMatch
[]>
Finds matches for the given entity.
Parameters
Name | Type |
---|---|
entity | Omit <MmEntity , "metadata" | "id" > |
options | MmFindMatchesOptions |
Returns
Promise
<MmEntityMatch
[]>
getEntity
▸ getEntity(entityId
): Promise
<undefined
| MmEntity
>
Returns the entity with the given ID.
Parameters
Name | Type |
---|---|
entityId | string |
Returns
Promise
<undefined
| MmEntity
>
getMatchMakerDetails
▸ getMatchMakerDetails(): MmMatchMaker
Returns an object with the matchmaker details.
Returns
insertEntity
▸ insertEntity(entity
): Promise
<void
>
Adds a new entity to the matchmaker - replaces existing entity with the same ID if exists.
Parameters
Name | Type |
---|---|
entity | MmEntity |
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
Name | Type |
---|---|
entities | MmEntity [] |
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
Name | Type |
---|---|
categoryId | string |
options | MmListEntitiesOptions |
Returns
Promise
<MmEntity
[]>