mongodb-erlang
mongodb-erlang copied to clipboard
Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true
How to send "allowDiskUse:true" in mongo_api:aggregate? Without this my req is failed.
-spec aggregate(atom() | pid(), collection(), bson:document(), integer()) -> {ok, cursor()} | []. aggregate(Topology, Collection, Pipeline, Batchsize) -> mongoc:transaction_query(Topology, fun(Conf = #{pool := Worker}) -> Query = mongoc:aggregate_query(Conf, Collection, Pipeline, Batchsize), mc_worker_api:command(Worker, Query) end, #{}).
Maybe is exists another way?