Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Last active March 12, 2018 21:02
Show Gist options
  • Save CliffordAnderson/10389565a993e469c056 to your computer and use it in GitHub Desktop.
Save CliffordAnderson/10389565a993e469c056 to your computer and use it in GitHub Desktop.
Bash / JQ for Cloudant Bulk Upload & Download
http -a #####:##### post https://5bf7ab22-9d65-400d-8db3-4aa44c4dd32e-bluemix.cloudant.com/map-berlin/_bulk_docs < docs.json
find . -name '*.json' -exec cat {} \; | jq -s '{"docs": [ .[] ]}'
http https://5bf7ab22-9d65-400d-8db3-4aa44c4dd32e-bluemix.cloudant.com/map-berlin/_design/editing/_view/editing | jq '{"docs": [.rows[].value] }' > docs.json
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
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