Last active
March 12, 2018 21:02
-
-
Save CliffordAnderson/10389565a993e469c056 to your computer and use it in GitHub Desktop.
Bash / JQ for Cloudant Bulk Upload & Download
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http -a #####:##### post https://5bf7ab22-9d65-400d-8db3-4aa44c4dd32e-bluemix.cloudant.com/map-berlin/_bulk_docs < docs.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.json' -exec cat {} \; | jq -s '{"docs": [ .[] ]}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http https://5bf7ab22-9d65-400d-8db3-4aa44c4dd32e-bluemix.cloudant.com/map-berlin/_design/editing/_view/editing | jq '{"docs": [.rows[].value] }' > docs.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http https://5bf7ab22-9d65-400d-8db3-4aa44c4dd32e-bluemix.cloudant.com/map-berlin/_design/tour/_view/Allied%20Occupied | jq '{"type":"FeatureCollection", "features": [.rows[].value] }' > docs.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.json' -exec cat {} \; | jq -s '{"docs": [ .[] ]}' > 'docs.json' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment