• Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 5.0.13
    • Component/s: None
    • None

      Hi,

      Error when running $merge into "atlas" from App Services trigger against MDB 5.0.13:
       

      exports = async function() {
        
          const clusterName = "profilehub-test01-env02";
          const db = "profilehub-test01-env02";
          const dest_coll = "individualsAuditCOPY5";
        
          const client = context.services.get('FederatedDatabaseInstance0')
          const archiveCol = client.db(db).collection(dest_coll);
        
          try {
        
              const pipe = [{
                "$addFields": {
                  "archived_date": new Date()
                }
              },{
                "$merge": {
                  "into": {
                    "atlas": {
                      "projectId": "",
                      "clusterName": clusterName,
                      "db": db,
                      "coll": dest_coll
                    }
                  }
                }
              }];
              
              await archiveCol.aggregate(pipe).toArray();
              
          } catch (err) {
              error = err;
              throw error;
          } finally {
            
          }
          
          return true;
          
        }; 

      Produces

      (BSONObjectTooLarge) PlanExecutor error during aggregation :: caused by :: BSONObj size: 17416355 (0x109C0A3) is invalid. Size must be between 0 and 16793600(16MB) First element: update: "individualsAuditCOPY5", correlationID = 17263d8e56dfeb8b8c5deee3

      This only occurs when total size of ALL documents to update is >16MB so is this related to:
      https://jira.mongodb.org/browse/SERVER-68845
       
      Testing against MDB 4.4.17 does not produce this error

      Note that individual documents are <16MB even with update of adding extra field

            Assignee:
            yuan.fang@mongodb.com Yuan Fang
            Reporter:
            greg.cox@mongodb.com Greg Cox
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: