Monday, June 25, 2012

diving into Mongo

I put the mongo source code at c:\mongo at my PC which means that mongod.exe is at c:\mongo\bin\mongod.exe

  • Mongo will store its files at c:\data\db\
  • I ran mongod.exe as administrator by right-clicking upon it.
  • With mongo running I then typed "cmd" at Windows 7's start menu to spin up a second shell where I entered all of my commands
    1. Typing "c:\mongo\bin\mongo.exe" returned the messages: "MongoDB shell version: 2.0.4" and "Connecting to: test" ...as if letting me into Mongo administration. Typing "exit" drops me back out again.
    2. http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/ asserts that "c:\mongo\bin\mongo.exe -- config c:\mongo\mongod.cfg --install" will install the service. This must be run from outside of administering Mongo.
    3. Running Mongo, I typed "use mydb" (which did not yet exist as a database) and was told "switched to db mydb"
      • Add stuff like so:
        1. j = { name : "mongo" };
        2. db.things.save(j);
      • see what is in the database with: db.things.find();

No comments:

Post a Comment