Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "$1"
- if [ "$1" = *".json" ]
- then
- sed 's/\\\\\\\"/\*\&\*/g' <$1 | sed 's/\\//g' | sed 's/\"//' | sed 's/\(.*\)\"/\1/' | sed 's/\*\&\*/\\\"/g' >import.json
- mongoimport --db mytest --collection authors --jsonArray --file import.json
- else
- echo "ERROR"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement