exceeds maximum document size

Zak Hoosen shared this question 5 years ago
Answered

Running a SQL query with a JOIN I get the following error. How can I get past this.

Replies (3)

photo
1

Use aggregation chain method, allowDiskUse.

Pipeline stages have a limit of 100 megabytes of RAM. If a stage exceeds this limit, MongoDB will produce an error. To allow for the handling of large datasets, use the allowDiskUse option to enable aggregation pipeline stages to write data to temporary files.

For example,


mb.runSQLQuery(`

       SELECT * FROM collection
       
`).sort({_id:-1})
  .allowDiskUse(); //chain method, allowDiskUse

photo
1

Thanks - No error now, but running for a long time without getting any data back.

photo
1

Without sample data and reproduction steps, it's hard for me to guess what the problem is, and it's hard to help you

Leave a Comment
 
Attach a file