Skip to content

Instantly share code, notes, and snippets.

@markembling
Created April 9, 2010 18:02
Show Gist options
  • Save markembling/361408 to your computer and use it in GitHub Desktop.
Save markembling/361408 to your computer and use it in GitHub Desktop.
Utility functions for MongoDB
# Start the MongoDB server running (foreground)
function Start-MongoD {
$dropBox = (Resolve-Path '~\Documents\My Dropbox').Path
$mongoConfig = "$dropBox\Software\MongoDB\mongo.conf"
$mongoData = "$dropBox\Software\MongoDB\data\"
& $dropBox\Software\MongoDB\bin\mongod.exe --config "'$mongoConfig'" --dbpath "'$mongoData'"
}
# Start the MongoDB client app
function Start-Mongo {
Push-Location ('~\Documents\My Dropbox\Software\MongoDB')
& .\bin\mongo.exe
Pop-Location
}
# Some aliases to make these easy to type & remember
Set-Alias mongod Start-MongoD
Set-Alias mongo Start-Mongo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment