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

LINQ queries against collections of type MongoCollection<BsonDocument> are not supported

    XMLWordPrintableJSON

Details

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

    Description

      var collection = database.GetCollection("testconnection");
      dynamic p = new MongoDB.Bson.ObjectModel.BsonDynamicDocument();

      p.Id = Guid.NewGuid();
      collection.Insert(p);
      var value = (Guid)p.Id;
      var item2 = collection.AsQueryable().Where(item => item.GetValue("Id") == value).FirstOrDefault();

      this is giving an error.

      I have attached a sample project and you can see it there.

      Attachments

        1. Mongo.rar
          4.97 MB

        Activity

          People

            Unassigned Unassigned
            teodor.georgiev Teodor Georgiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: