Currently repo.fetch(ids) translates to awaiting multiple JSON.GET. Performance might be improved by replacing JSON.GET with JSON.MGET.
|
private async readEntitiesFromJson(ids: string[]): Promise<T[]> { |
|
return Promise.all( |
|
ids.map(async (entityId): Promise<T> => { |
|
const keyName = this.makeKey(entityId) |
|
const jsonData = await this.client.jsonget(keyName) ?? {} |
|
const entityData = fromRedisJson(this.#schema, jsonData) |
|
return {...entityData, [EntityId]: entityId, [EntityKeyName]: keyName} as T |
|
})) |
|
} |
Currently
repo.fetch(ids)translates to awaiting multipleJSON.GET. Performance might be improved by replacingJSON.GETwithJSON.MGET.redis-om-node/lib/repository/repository.ts
Lines 355 to 363 in 6f08d02