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

Linq Driver Performing pipeline instead of find on query

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 2.10.3
    • None
    • None

    Description

      Reporting this as a bug BUT i would have expected the linq query to generate the same qeury under the covers as the find query.  Instead the linq query is generating an aggregation pipeline.

       

      ```

            var document = GetCollection<MediaDocument>()

                      .Find(x => x.ImageUniqueIdentifier == imageUniqueIdentifier)

                      .FirstOrDefault();

      ```

       

      ```

                  var document = GetCollection<MediaDocument>()

                      .AsQueryable()

                      .Where(x => x.ImageUniqueIdentifier == imageUniqueIdentifier)

                      .FirstOrDefault();

      ```

      Attachments

        Activity

          People

            Unassigned Unassigned
            michael_fyffe@homedepot.com Michael Fyffe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: