Search code examples
c#mongodbmongodb-.net-driver

C# MongoDB.Driver 2.2. - Usage of GridFs


I 've used the GridFs functions with the legacy mongo db c# driver in the following way.

var file = Database.GridFS.FindOne(Query.EQ("_id", ObjectId.Parse(file.Id)));

The MongoDb C# 2.1 driver, implements GridFs in an other way, could somebody show me please an example? I've found no documentation yet.


Solution

  • The .NET driver documentation has a detailed guide on using GridFS. http://mongodb.github.io/mongo-csharp-driver/2.2/reference/gridfs/