[SERVER-12817] Read only commands should validate their namespaces Created: 21/Feb/14 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Querying |
| Affects Version/s: | 2.6.0-rc0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Davide Italiano | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | 26qa, aggregation, grab-bag, query-44-grooming, usability | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The server has many read-only commands which do not validate their collection names. Our documentation mentions that empty collection names, or collection names containing a "$" are not allowed, so commands like the following should probably error instead of returning no results:
Original Descriptionhttp://docs.mongodb.org/manual/reference/limits/ mentions that collection names containing $ or being empty are not allowed. OTOH, aggregate takes them as argument without complaining. Aggregating over an invalid namespace should not be a legal operation, in my opinion. Examples:
|
| Comments |
| Comment by Asya Kamsky [ 03/Aug/20 ] | ||||||||||||||
|
In 4.4.0 it is only a problem with aggregate command - all the other examples now return
| ||||||||||||||
| Comment by Charlie Swanson [ 03/Feb/16 ] | ||||||||||||||
|
I've updated the description to be more general, as this is not just a problem with aggregation. | ||||||||||||||
| Comment by Davide Italiano [ 21/Feb/14 ] | ||||||||||||||
|
It may be consistent with the query system but I see an inconsistency in validation among all the field you can pass to the aggregation command. | ||||||||||||||
| Comment by Scott Hernandez (Inactive) [ 21/Feb/14 ] | ||||||||||||||
|
This is not really an aggregation issue. We do the same with queries and pretty much everything:
If we want to change them all, great, otherwise this is really works as designed and is already consistent with our query system. |