Skip to content

Instantly share code, notes, and snippets.

@martin-cowie
Created May 17, 2016 13:09
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 martin-cowie/2e95106e46ab48d6d3821f0dd8a15553 to your computer and use it in GitHub Desktop.
Save martin-cowie/2e95106e46ab48d6d3821f0dd8a15553 to your computer and use it in GitHub Desktop.
Example of Mongo shell interaction, creating 100 documents.
% mongo localhost:20001

MongoDB shell version: 3.2.6

connecting to: localhost:20000/test
testReplSet:PRIMARY> use someDB

switched to db someDB
testReplSet:PRIMARY> for (i=0; i<100; i++) { db.someCollection.insert({count: i}) }

WriteResult({ "nInserted" : 1 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment