Skip to content

Instantly share code, notes, and snippets.

@mandric
Created June 16, 2016 16:40
Show Gist options
  • Save mandric/46998fadb9e3c8ad50409da2af168a1a to your computer and use it in GitHub Desktop.
Save mandric/46998fadb9e3c8ad50409da2af168a1a to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Do bulk edit request.
#
SELF=`basename $0`
COUCH_URL=${COUCH_URL-http://admin:secret@localhost:5988}
DOCS="$1"
if [ -z "$DOCS" ]; then
echo "Usage: ./$SELF docs.json > results.json"
exit 1
fi
curl -sf -H 'content-type: application/json' \
-H 'accept-encoding:gzip,deflate' \
-d @"$DOCS" \
"$COUCH_URL/medic/_bulk_docs" | gzip -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment