MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

GridFS file download, C# driver

I have a c# .net core project where I am trying to download a file which I have stored in GridFS. The upload works fine and using 3T studio I can access the files but any of the download commands throw an exception

var bucket = new GridFSBucket(_context.Database);  
var bytes = bucket.DownloadAsBytesByName("b7be1813-589a-4a0b-b720-70f9efd165aa");

The exception thrown is:

Command find failed: Error=2 {“Errors”:[“The index path corresponding to the specified order-by item is excluded.”]

I don’t understand what is wrong here, I used the driver to create the GridFS bucket initially so the indexes should be correct, I don’t know what it would be trying to order by which would cause this issue. No matter which download command I use they all fail with the same erro

Any help appreciated