-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.0
-
Component/s: Querying
-
Query
-
(copied to CRM)
In the mongo aggregation framework is possible to use the option
{allowDiskUse:true}. This is really useful when some heavy operations such as sorting, which cannot be performed in memory.
I'm trying to do the same with createView (available in Mongo 3.4), but it seems that this possibility is currently unavailable. For instance,
db.mydb.aggregate([....,{$sort:{"a":-1}}],{allowDiskUse:true})
works, but:
db.createView("newview","mydb",[....,{$sort:{"a":-1}}],{allowDiskUse:true})
produces the error
The field 'allowDiskUse' is not a valid collection option.
Of course, I can just remove
{allowDiskUse:true}. Then the view is created, but when I try:
> db.newview.find() Error: error: { "ok" : 0, "errmsg" : "Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.", "code" : 16819, "codeName" : "Location16819" }
Thus I would suggest to add the option allowDiskUse to createView.
- is duplicated by
-
SERVER-40456 Add allowDiskUse option to createView
- Closed
- related to
-
SERVER-36410 View definitions should permit specifying allowDiskUse:true and other aggregation options as part of the view.
- Closed