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

Gridfs Fails to filter on Metadata after upgrading to 2.3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Gone away
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: GridFS
    • Labels:

      Description

      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.
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: