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

Support use of BsonValue.AsString in filters (and all other AsXyz properties also)

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Unknown Unknown
    • 2.16.0
    • None
    • LINQ3
    • None

    Description

                  var result = Builders<BsonDocument>.Filter.Where(x => x["_id"].AsString != "");
                  var registry = BsonSerializer.SerializerRegistry;
                  var serializer = registry.GetSerializer<BsonDocument>();
                  var mql = result.Render(serializer, registry, Linq.LinqProvider.V3); 

      the above generates incorrect mql: 

      { "_id.AsString" : { "$ne" : "" } }

      where "AsString" BsonDocument method is recognized as mql field name

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: