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

Translate string.IsNullOrEmpty using $in instead of $or/$eq

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.14.0
    • Affects Version/s: None
    • Component/s: LINQ3
    • Labels:
      None

      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, '']] }

       

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: