Exceeded Memory Limit despite allowDiskUse set to true

381 Views Asked by At

I get the same error StitchServiceError {message: "(Location16945) Exceeded memory limit for $group, … external sort. Pass allowDiskUse:true to opt in.", name: "StitchServiceError", errorCode: 11, errorCodeName: "MongoDBError" whether or not I pass {allowDiskUse:true}.

I am passing the option as follows:

    db.col.aggregate(
              [
{
            $match: {
              ...
            }
          },
          {
            $group: {
              _id: "$...",
              items: {
                $push: {
                  ...
                }
              }
            }
          }
       ],
              {allowDiskUse:true}
            ).toArray().then(items => { console.log(items); this.setState({ forecast: items }) })

As suggested here: MongoDB allowDiskUse not working..

I am using mongodb-stitch-browser-sdk

0

There are 0 best solutions below