How to pass allowDiskUse=true option to aggregate function?

32 views
Skip to first unread message

James Qiu

unread,
Dec 15, 2017, 9:11:25 PM12/15/17
to congomongo-dev
Usage like:
(aggregate :collname {:$group {..}} {:allowDiskUse true})
is no use.
It's still give error msg:
CompilerException com.mongodb.CommandFailureException: { "serverUsed" : "127.0.0.1:27017" , "ok" : 0.0 , "errmsg" : "Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in." }
Help!

Sean Corfield

unread,
Dec 16, 2017, 6:12:10 PM12/16/17
to congomongo-dev
I thought I'd answered this already but don't see the response on the list...

Try:

    (aggregate :collname {:$group {..} :allowDiskUse true})

According to the MongoDB docs, that option goes on the top-level aggregate operation.

Note: CongoMongo uses a deprecated API for aggregate and there are no tests at all for aggregate. Also, it has not been updated since before MongoDB 3.0 appeared (although I believe it works with 3.0). It uses the old 2.x drivers. I have no plans to update it -- we're in the process of migrating off MongoDB at work and, even before that decision, I was considering migrating our code base to Monger since that is much better maintained and much better documented. CongoMongo is pretty much abandonware at this point. I think it has very few users and all the maintainers seem to have either moved on from Clojure or moved on from MongoDB (or both).

Sean
Reply all
Reply to author
Forward
0 new messages