Skip to content

Instantly share code, notes, and snippets.

@alejandromav
Last active June 28, 2023 08:45
Show Gist options
  • Save alejandromav/0a3774b376118e9952e103aadcb57f4f to your computer and use it in GitHub Desktop.
Save alejandromav/0a3774b376118e9952e103aadcb57f4f to your computer and use it in GitHub Desktop.
Tinybird MongoDB Connector v0.0.0
FILE=~/tmp/items.ndjson
mongoexport \
--uri="mongodb://<user>:<pass>@alejandromav.mongodb.net/?retryWrites=true&w=majority" \
-d=my_db \
-c=Items \
-o=$FILE
curl \
-H 'Authorization: Bearer $TINYBIRD_APPEND_TOKEN' \
-X POST 'https://api.tinybird.co/v0/datasources?format=ndjson&name=items&mode=replace' \
-F "ndjson=@$FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment