FindOneById() public method

Finds a GridFS file.
public FindOneById ( BsonValue id ) : MongoDB.Driver.GridFS.MongoGridFSFileInfo
id BsonValue The GridFS file Id.
return MongoDB.Driver.GridFS.MongoGridFSFileInfo
コード例 #1
0
ファイル: Resumable.cs プロジェクト: senghuot/resumable
 // check if the uploaded file integrity
 private void checkFileIntegrity(MongoGridFS grid, string id, BsonDocument metadata)
 {
     Console.Write("Checking file upload integrity: ");
     var downloadInfo = grid.FindOneById(ObjectId.Parse(id));
     var downloadMD5 = getMD5(downloadInfo.OpenRead());
     if (metadata["md5"] == downloadMD5)
         Console.WriteLine("PASS");
     else
         Console.WriteLine("FAIL");
 }