For the purposes of this example, we'll restore four collections of the biglittle database. The data is restored on the shard1 server only. Later, we'll shard the last collection, world_cities (covered in later subsections).
For the purposes of this illustration, the sample data is mapped to the /data/common directory in the Docker container representing shard1. You can perform the restore by running the shell scripts from a Terminal window inside the container, as shown here:
docker exec -it learn-mongo-shard-1 /bin/bash
mongo --port 27018 /data/common/biglittle_common_insert.js
mongo --port 27018 /data/common/biglittle_loans_insert.js
mongo --port 27018 /data/common/biglittle_users_insert.js
mongo --port 27018 /data/common/biglittle_world_cities_insert.js
Alternatively, from outside the container, use the /path/to/repo/chapters/14/restore_sample_data.sh script, as shown here:
#!/bin/bash
docker exec learn-mongo-shard-1 /bin/bash -c \
"mongo...