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

AsQueryable Linq Condition and BsonDocument Filter

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.7.3
    • API
    • ASP.net Core / WEB API

    Description

      Hi All,

         I have one Model Class its ID element contain BsonDocument  and rest of the properties are normal BsonElement ,i would like to Get the information from the DB with normal Linq Condition and Filter inside the BsonDocument also , Please let me know how can i do that

      Eg : 
      Var Items = Collection.AsQueryable<Tclass>().Where(p=> p.FirstName="sd" && p.Id.Country=="sd").ToList()

      Model :

      [BsonElement("ID")]
      public BsonDocument Id { get; set; }-- ID Contains / Address / Place /Country etc 

      [BsonElement("FirstName")]
      public string FirstName{ get; set; }

      Thanks 
      SUJIL T

      Attachments

        Activity

          People

            wan.bachtiar@mongodb.com Wan Bachtiar
            thavidatt_sujil SUJIL
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: