First, find the container that runs your MongoDB and ssh into it.
Then, find the collection you want to export:
mongo
show dbs
use <database>
show collections
exit
Then, run mongoexport command in the shell (not in mongo):
mongoexport -d <database-name> -c <collection-name> --out output.json
Then, on your local machine, copy the file from inside the docker container to your current folder:
docker cp <mongodb docker container name>:/output.json .
Don't forget the dot from the end.