dimanche 26 avril 2015

mongodb gridfs in C# new api


i am new with MongoDB, and i can't find GridFS. Where can i get GridFS to store files now ?

I can get it this way:

mongoClient = new MongoClient(Settings.Default.MongoDB);
var server = mongoClient.GetServer();
MongoDatabase = server.GetDatabase(Settings.Default.DatabaseName);
MongoDatabase.GridFS...

but GetServer() method is obsolete.

if I get database as here:

MongoDatabase2 = mongoClient.GetDatabase(Settings.Default.DatabaseName);
MongoDatabase2.GridFS... not working

Then i receive IMongoDatabase instead MongoDatabase, and i didnt have GridFS.


Aucun commentaire:

Enregistrer un commentaire