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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.9
    • Affects Version/s: 1.6.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

        1. Mongo.rar
          4.97 MB
          Teodor Georgiev

            Assignee:
            Unassigned
            Reporter:
            Teodor Georgiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: