|
When going through M034 with MongoDB 3.4.1 on Mac OS X Yosemite v 10.10.5 I generated a seg fault on the server by running the following query on the following dataset. Backtrace attached. Seg fault also generated on 3.4.0. with the same query and dataset.
Dataset: https://university.mongodb.com/static/MongoDB_2016_M034_ondemand_v1/handouts/companies_dataset/companies.2a9d317cfa74.json
db.companies.aggregate( [
|
{'$match': { 'number_of_employees' : {'$type': 'int'} }},
|
{ '$facet': {
|
'Employees': [
|
{'$bucketAuto': {
|
'groupBy': '$number_of_employees',
|
'buckets': 3,
|
'granularity': '1-2-5',
|
'output': {
|
value: {$max: '$number_of_employees'}
|
}
|
}}],
|
}
|
}]).pretty()
|
However the same query replacing '$max' with '$sum' works just fine.
db.companies.aggregate( [
|
{'$match': { 'number_of_employees' : {'$type': 'int'} }},
|
{ '$facet': {
|
'Employees': [
|
{'$bucketAuto': {
|
'groupBy': '$number_of_employees',
|
'buckets': 3,
|
'granularity': '1-2-5',
|
'output': {
|
value: {$sum: "$number_of_employees"}
|
}
|
}}],
|
}
|
}]).pretty()
|
|