Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1819

Gridfs Fails to filter on Metadata after upgrading to 2.3

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: 2.3
    • Component/s: GridFS

      Today i upgraded my nuget packages to version 2.3. Iam using a FilterDefinition on GridfsFileInfo like this:

      var filter = Builders<GridFSFileInfo>.Filter.Eq(x => x.Metadata["ContainerId"],containerId);
      
      var results = await this.Storage.Find(filter).ToListAsync();
      

      Before this upgrade this worked, now iam getting an error:

      System.MethodAccessException: Attempt by method 'MongoDB.Driver.GridFS.GridFSBucket.Find(MongoDB.Driver.FilterDefinition`1<MongoDB.Driver.GridFS.GridFSFileInfo>, MongoDB.Driver.GridFS.GridFSFindOptions, System.Threading.CancellationToken)' to access method 'MongoDB.Driver.BatchTransformingAsyncCursor`2<System.__Canon,System.__Canon>..ctor(MongoDB.Driver.IAsyncCursor`1<System.__Canon>, System.Func`2<System.Collections.Generic.IEnumerable`1<System.__Canon>,System.Collections.Generic.IEnumerable`1<System.__Canon>>)' failed.
      

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            swebernoerr Stefan Weber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: