Eugene
Eugene

Reputation: 1125

Set allowDiskUse:true in mongodb compass aggregation

I am having trouble trying to call {allowDiskUse:true} in the mongodb compass GUI tool. I have created a view based on an aggregation of another collection. The view returns an error of

Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting.

Hence i saw that it is required to append {allowDiskUse:true} but i am unable to find a suitable place to call. There is a possibility to use the $out stage to write to another collection but I would like to try the view first :)

ADD ON: I have tried to run the query db.noDups.aggregate([],{allowDiskUse : true }); in command line and it works. But I would like to execute in MongoDB compass for the visualization and exporting function.

I also tried {},{},{allowDiskUse: true} in the filter condition but still no luck :(

Btw I am on MongoDB 4.2.6 Community and MongoDB compass 1.25.0

enter image description here

enter image description here

Upvotes: 4

Views: 3816

Answers (1)

Bik Dhaliwal
Bik Dhaliwal

Reputation: 31

I tried appending it to the filter and it didn't work. I've looked on many different forums and kind find a solution for allowDiskUse from Compass. This seems kind of crazy that you need to add such a kludgy option to even do modest groupings on small amounts of data.

I also have been looking to see how to increase the amount of memory that Mongo can use to get around having to do this. I have Mongo installed on a server with 512GB of memory, it seems rather silly to have developers jumping through hoops like this.

Upvotes: 2

Related Questions