[SERVER-36410] View definitions should permit specifying allowDiskUse:true and other aggregation options as part of the view. Created: 02/Aug/18  Updated: 06/Dec/22  Resolved: 17/Aug/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: William Byrne III Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Fix Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-27440 Add allowDiskUse option to createView Closed
Assigned Teams:
Query
Participants:
Case:

 Description   

The createView() command is just a wrapper for the create command That is why the view creation options are a subset of those available when creating collections, rather than those for aggregation statements.

When querying a view with an aggregate operation, users can specify allowDiskUse:true and non default values for allowDiskUse, cursor, maxTimeMS, and readConcern. But when querying a view with a find operation, users cannot do that.

When creating a view, I suggest allowDiskUse:true and perhaps some of the other aggregation options should be able to be included in the definition. The values for these fields would then become part of the aggregation statements generated for queries against the view.



 Comments   
Comment by Kyle Suarez [ 17/Aug/18 ]

Hey william.byrne,

The Query Team does not want to implement this feature. Looking at the scope and design documents, we did not explicitly call out the allowDiskUse option, but there are some reasons behind our decision:

  • Users can create views on views. It's unclear what the semantics would be when querying a view on a view where the different views have varying options for allowDiskUse, cursor, etc.
  • It might encourage people to create views that differ solely on "meta" options. I think we would prefer people to use the options available on the find command itself, which should be passed on.

As a workaround, users can instead run the aggregate command on the view.

Comment by Asya Kamsky [ 17/Aug/18 ]

> But when querying a view with a find operation, users cannot do that

Why can't users specify maxTimeMS, readConcern, etc. when using find?

Comment by William Byrne III [ 02/Aug/18 ]

Somewhat a duplicate of SERVER-27440. That is for allowDiskUse only, whereas this covers other aggregation modifiers like cursor and readConcern.

Generated at Thu Feb 08 04:43:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.