[CSHARP-4191] Support use of BsonValue.AsString in filters (and all other AsXyz properties also) Created: 01/Jun/22  Updated: 28/Oct/23  Resolved: 02/Jun/22

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: None
Fix Version/s: 2.16.0

Type: Bug Priority: Unknown
Reporter: Dmitry Lukyanov (Inactive) Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CSHARP-3615

 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



 Comments   
Comment by Githook User [ 02/Jun/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4191: Support use of BsonValue.AsString in filters (and all other AsXyz properties also).
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a83a6bb7ce3cc50c5feece5d665bddf3386f40ec

Generated at Wed Feb 07 21:47:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.