Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/9717295 to your computer and use it in GitHub Desktop.
Save garystafford/9717295 to your computer and use it in GitHub Desktop.
From blog post, Retrieving Data with AngularJS and the MEAN Stack: http://wp.me/p1RD28-16F. Install the sample database, collection, and documents.
start mongod # starts mongod in a separate window
mongo # starts interactive MongoDB Shell for remaining commands
# tip: once the mongo shell has started, you can copy and paste
# the commands below into the shell, all at once
use meanstack-test // creates database if it does not exist
db.components.insert({ "component": "mongod",
"description": "core database process" })
db.components.insert({ "component": "mongos",
"description": "controller and query router for sharded clusters" })
db.components.insert({ "component": "mongo",
"description": "interactive MongoDB Shell" })
db.components.insert({ "component": "mongodump",
"description": "utility for creating binary export of database contents" })
db.components.insert({ "component": "mongorestore",
"description": "writes data from a binary database dump to a MongoDB instance" })
db.components.insert({ "component": "mongooplog",
"description": "polls operations from the replication oplog" })
show collections // verifies the components collection was created
db.components.find().pretty() // verifies documents were created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment