Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1454

Use $not as a top-level logical op

    XMLWordPrintable

    Details

    • Backport Requested:
      v4.4, v4.2, v4.0
    • Sprint:
      Query Optimization 2021-06-14, QO 2021-09-20, QO 2021-10-04, QO 2021-10-18, QO 2021-11-01
    • Case:

      Description

      In our MongoDB-CSharp driver we convert code expressions like that to documents queries.

      !(Address.IsDefault && Adress.Name=="foo")
      

      The problem here is that the ! operator reverses the meaning of both equality checks. This scenario would be much easier to accomplish when we could use the $not operator like the $or operator.

      Example:

      { $not : [ 
          { "Address.IsDefault" : true },
          { "Address.Name" : "foo" }
      ] }
      

      I think also that this is more the way the users expect to use the $not operator.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jacob.evans Jacob Evans
              Reporter:
              lanwin Steve Wagner
              Participants:
              Votes:
              17 Vote for this issue
              Watchers:
              22 Start watching this issue

                Dates

                Created:
                Updated: