Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Last active May 10, 2018 02:45
Show Gist options
  • Save sarjarapu/b0398ebb501bf9c602af7eb3db3485ae to your computer and use it in GitHub Desktop.
Save sarjarapu/b0398ebb501bf9c602af7eb3db3485ae to your computer and use it in GitHub Desktop.
A bash script to help you download, import and generate load on the sample restaurant database.
#!/bin/sh
# download and import the restaurant sample data set
wget https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/primer-dataset.json
mongoimport --db guidebook --collection restaurants --type json --file ./primer-dataset.json
# download and run the load generation script
wget https://goo.gl/BXHH2d -O labs-performance-restaurant.js
mongo guidebook --eval "load('./labs-performance-restaurant.js');r.performReads();" > /dev/null 2>&1 &
# open mongo shell and practice all the above use cases for currentOp
mongo guidebook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment