JoniBR
5/12/2019 - 6:10 PM

Export Collection from local Mongo DB on Docker #mongo #docker

Export Collection from local Mongo DB on Docker #mongo #docker

#Export from mongo:
#Bash into docker : 
docker exec -it <container_id> /bin/bash
#Export collection: 
mongoexport --db <db_name> -c <collection_name> --out <file_name>.json
# back to local shell
exit
#CoPy file :
docker cp <container-id>:/path/to/file ./local-dir