[SERVER-6198] $group aggregate field names can contain dots, may cause problems with sharding Created: 25/Jun/12 Updated: 29/Aug/12 Resolved: 27/Jul/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Matt Dannenberg |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Observed behavior: It is possible to create a $group aggregate field with a field name containing a dot. I think the dots might cause a problem when a group merger on mongos attempts to access fields set in the mongod results, but I haven't tested that specifically. Test:
Result:
|
| Comments |
| Comment by auto [ 27/Jul/12 ] |
|
Author: {u'date': u'2012-07-23T07:34:09-07:00', u'email': u'dannenberg.matt@gmail.com', u'name': u'Matt Dannenberg'}Message: |
| Comment by auto [ 20/Jul/12 ] |
|
Author: {u'date': u'2012-07-14T12:04:12-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}Message: Rewrite ExpressionObject The main difference between this version and the old is that the following // classic inclusion // nested inclusion {'a.b': '$a.b'} // dotted FieldPathExpression // nested FieldPathExpression Additionally support for exclusion of fields other than _id has been Other related bugs:
Remaining TODOs: Disabled test for |
| Comment by Mathias Stearn [ 20/Jul/12 ] |
|
For now just assert !str::contains(fieldName, '.') and fieldName[0] != '$'. If we chose to support nesting we can do that later. |
| Comment by Mathias Stearn [ 03/Jul/12 ] |
|
Ideally that should probably produce {z:{x:[2,1]}}, but that may depend on |