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

Support Fieldname Indexers in a Linq Query

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.9
    • None
    • None
    • None

    Description

      BsonDocuments should be able to be used in LINQ queries for when BsonDocuments are either the root or exposed as properties.

      query = Query<BsonDocument>.Where(doc => doc["Name"] == "Bob McBob");
       
      //
       
      query = Query<BsonDocument>.Where(doc => doc["Children"][0]["Name"] == "Jack");
       
      //
       
      query = Query<BsonDocument>.Where(doc => doc["Children"][0]["Age"] > 20);

      Attachments

        Activity

          People

            craig.wilson@mongodb.com Craig Wilson
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: