Skip to content

Add script to clean up rates documents from a provider#121

Merged
peachbits merged 1 commit intomasterfrom
clean-rates-script
Dec 4, 2025
Merged

Add script to clean up rates documents from a provider#121
peachbits merged 1 commit intomasterfrom
clean-rates-script

Conversation

@peachbits
Copy link
Copy Markdown
Collaborator

@peachbits peachbits commented Dec 2, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

*/

const mappingDocId = 'coingecko:automated'
const endTime = 1757289600000 // rates server PR merged september 8th 2025
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this an isodate in the future.


try {
// Fetch document from rates_data database
const rawDoc = await dbData.get(docId)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time, use a .find with a selector of the date range and then a limit with a batch size. This lets you fetch multiple docs at once. No need to try to actually create the doc ids.

@peachbits peachbits merged commit bb7053d into master Dec 4, 2025
1 check passed
@peachbits peachbits deleted the clean-rates-script branch December 4, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants