Created
June 3, 2014 11:32
-
-
Save Gab-km/25b00d110e4fea0306a4 to your computer and use it in GitHub Desktop.
MongDB の C# Driver を PowerShell から使ってみた
This file contains hidden or 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
[System.Reflection.Assembly]::LoadFile('/path/to/MongoDB.Driver.dll') | |
[System.Reflection.Assembly]::LoadFile('/path/to/MongoDB.Bson.dll') | |
$client = New-Object MongoDB.Driver.MongoClient("mongodb://hostname") | |
$server = $client.GetServer() | |
$db = $server.GetDatabase("test") | |
$user = $db.GetCollection("User") | |
foreach($doc in $user.FindAll() { | |
[System.Console]::WriteLine($doc) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment