Skip to content

Cloud function that updates the database with new data from the GDELT bigQuery dataset

Notifications You must be signed in to change notification settings

margacampos/mongodb-hackathon2022-cloud-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongodb-hackathon2022-cloud-function

Cloud function that updates the MongoDB database for the The Newsroom project with new data from the GDELT BigQuery dataset.

Explanation:

This cloud function is triggered by a Pub/Sub message and therefore listens for event and context. You can find more about cloud functions triggered by Pub/Sub here.

Once it is triggered, it creates a query job on BigQuery and saves that job to then retrieve the query results. You can find more information about how to do this here.

After it makes sure the information has been retrieved, it deletes all documents on the MongoDB database and inserts the new ones.

Once this is done, it updates all the documents with its respective titles by calling the https://mongo-db-hackathon-2022.vercel.app/news-title-generator.

About

Cloud function that updates the database with new data from the GDELT bigQuery dataset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published