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)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.16.0
    • Affects Version/s: None
    • Component/s: LINQ3
    • None

                  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

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

              Created:
              Updated:
              Resolved: