Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Total size of documents in members matching pipeline exceeds maximum document size

I have a relatively small dataset, 10k documents, and need to ‘join’ 2 collections (accounts and members).
accounts:

{_id: '1234",
name: 'big account'
}
{_id:'6789',
name: 'small_account'

members

{_id: 'abcd',
account: '1234'}
{_id: "qwer",
account: '1234'}
{_id: 'zyxw',
account: '6789'

The lookup stage of the aggregation pipeline is unable to complete in the view I’ve created throwing the following error:

total size of documents in members matching pipeline { $match: { $and: [ { site: { $eq: ObjectId('xxxxxxxxx') } }, {} ] } } exceeds maximum document size

My question is this: as a first step in the aggregation pipeline, I wanted to get rid of this document to see if the rest of the collection would work :

{$match: { 
    _id : {
        $nin: {
            "xxxxxxxxxxx"
         }
     }
  }
}

The doc appears to have been filtered out, when I test by trying to match to it later in the pipeline without success, but the view still throws the same error with the same objectId, which makes me think it is still being called in the $lookup stage.

I could use some help figuring out how to get this view to work and figure out how this doc that has been filtered out continues to jam up the pipeline.

This was driving me crazy, but it turns out that modifying a view, and then clicking ‘update view’ does not actually save the updates. I had to delete the view, iterate, resave another view, to check if it worked.

Hope that this helps some one.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.