I am unable to get GridFS working on my computer. I am using .Net nuget MongoDb.Driver and I am trying to upload file to mongodb like this:
MongoClient client = new MongoDB.Driver.MongoClient();
IMongoDatabase dtb = client.GetDatabase("test");
GridFSBucket bucket = new GridFSBucket(dtb);
using (var stream = File.Open(@"<path>", FileMode.Open))
{
ObjectId id = bucket.UploadFromStream("data", stream);
var data = bucket.DownloadAsBytes(id);}
But if fails with exception: "MongoDB.Driver.MongoCommandException: Command listIndexes failed: ns does not exist: test.ts.files"
The same code works on other computer, fails on my computer. I even reinstalled the mongo with total cleanup. Weirdly the same function worked at first, then only for one specific database and after few tests nothing works.
I am sorry that I cannot provide any more information.