Skip to content

Instantly share code, notes, and snippets.

@jorgesancha
Created August 12, 2023 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgesancha/d0f34478848aa79886b0ee52e4035106 to your computer and use it in GitHub Desktop.
Save jorgesancha/d0f34478848aa79886b0ee52e4035106 to your computer and use it in GitHub Desktop.
# Mongo to Tinybird
mongoexport --uri mongodb+srv://<username>:<password>@<your_cluster>mongodb.net/sample_analytics --collection customers --type csv -f _id,username,name,address,birthdate,email,active,accounts,tier_and_details | \
curl -H 'Authorization: Bearer <tb_token>' \
-X POST 'https://api.us-east.tinybird.co/v0/datasources?format=csv&name=customers&mode=create' \
-F csv=@-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment