Created
April 9, 2010 18:02
-
-
Save markembling/361408 to your computer and use it in GitHub Desktop.
Utility functions for MongoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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