[CSHARP-3898] Translate string.IsNullOrEmpty using $in instead of $or/$eq Created: 08/Oct/21  Updated: 28/Oct/23  Resolved: 08/Oct/21

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

Type: Improvement Priority: Unknown
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently LINQ3 is translating string.IsNullOrEmpty(document.F) the same way as LINQ2 as:

 { $or : [{ $eq : ['$F', null] }, { $eq : ['$F', ''] }] }

but a shorter equivalent form is available:

 { $in : ['$F', [null, '']] }

 



 Comments   
Comment by Githook User [ 08/Oct/21 ]

Author:

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

Message: CSHARP-3898: Translate string.IsNullOrEmpty using $in instead of $or/$eq
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/057c592f67f04cffc07dc983e9a15cc98003c17d

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