We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
import { tables } from '@architect/functions' import { ReturnValue } from '@aws-sdk/client-dynamodb' import type { DynamoDBDocument } from '@aws-sdk/lib-dynamodb' import { paginateScan, UpdateCommand } from '@aws-sdk/lib-dynamodb' import { type Circular, parseEventFromSubject, } from '~/routes/circulars/circulars.lib' export async function backfill() { console.log('Starting backfill...') const db = await tables() const client = db._doc as unknown as DynamoDBDocument const TableName = db.name('circulars') const pages = paginateScan( { client }, { TableName, } ) for await (const page of pages) { for (const record of page.Items || []) { const circular = record as unknown as Circular const validEvent = circular.eventId || parseEventFromSubject(circular.subject) if (!circular.eventId && validEvent) { const updateParams = { TableName, Key: { circularId: circular.circularId, }, UpdateExpression: 'SET eventId = :eventId', ExpressionAttributeValues: { ':eventId': validEvent, }, ReturnValues: ReturnValue.UPDATED_NEW, } await client.send(new UpdateCommand(updateParams)) } } } console.log('... End backfill') } await backfill()
Sorry, something went wrong.
blocked till #2661 goes in as it uses a function defined in that PR.
Courey
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: