...
Code Block |
---|
public async getByUserServiceLookup( phoneNumber: string, ): Promise<IUserLookupByPhone[] | undefined> { const dynamoSearch = { ExpressionAttributeValues: { ':pk2': `phone_lookup#${phoneNumber}`, ':sk2': 'createdAt#', }, IndexName: 'brand-index-2', KeyConditionExpression: 'pk2 = :pk2 AND begins_with(sk2, :sk2)', TableName: this.tableName, }; const { Items } = await this.executeWithRetry(DynamoMethods.query, dynamoSearch); return Items ? Items.map((item) => cast(item, TUserLookupByPhone)) : undefined; } |
And created 4 lookup records for 2 customers:
...