'$mergeObjects' not a recognized expression (Mac build)

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None


      name: 🐞 Bug
      about: For the mac build version of pymongo, the mergeObjects expression does not seem to be included in the build. The mergeObjects expression works for the windows build.
      title: '[BUG] $mergeObjects not a recognized expression'

          1. Current Behavior:

      We have a dataset with a nested object. We want to group by an id and have the nested object at the id level. We then want to merge those objects to a list and output that list.
      For the aggregation query:

      pipeline = [
          {
              "$match": {
                  ...
              }
          },
          ...
          {
              "$group": {
                  "_id": {
                      "id": "$id"
                  },
                  "nestedObject": {"$first": "$$ROOT"}
              }
          },
          ...
          {
              "$replaceRoot": {
                  "newRoot": {"$mergeObjects": ["$otherDataset"]}
              }
          }
      ]

      The following error occurs:

      E pymongo.errors.OperationFailure: Unrecognized expression '$mergeObjects'
      
      /Users/<user>/opt/miniconda3/envs/<env>/lib/python3.9/site-packages/pymongo/helpers.py:159: OperationFailure
          1. Expected Behavior:
            The mergeObjects should be a recognized operation and the query about should work
          1. Environment:
      • OS: Big Sur 11.6
      • Python: 3.9.7
      • Pymongo: 3.11.3

      Thank you for your help in this matter

            Assignee:
            Unassigned
            Reporter:
            Matthew Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: