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

Add bitwise AND, OR, XOR to aggregation pipeline

    XMLWordPrintable

Details

    Description

      We already have support for bitwise operators - and, or, xor, complement - in both the query and update paths. It would be nice to have this in aggregation as well.

      This would allow users run pipelines like:

      db.foo.aggregate({
        "$project": {
          "flipped": {
            "$bitComplement": "$a"
          }
        }
      })
      db.foo.aggregate({
        "$project": {
          "xored": {
            "$bitXor": [
              NumberInt("10"),
              "$a",
              1,
            ]
          }
        }
      })

      Attachments

        Issue Links

          Activity

            People

              davis.haupt@mongodb.com Davis Haupt
              adinoyi.omuya@mongodb.com Adinoyi Omuya
              Votes:
              10 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated: