-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Query Optimization
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
I am hoping I am simply missing something so obvious I am ignoring it.
This works:
c=db.cscl2.aggregate([ {$bucket: {"groupBy": "$length", boundaries: [0,5,10,15], default:"other" }} ]); show(c);
This does not:
c=db.cscl2.aggregate([ {$bucket: {"groupBy": "$length", boundaries: {$range: [0,20,5 ]}, default:"other" }}]); show(c); "errmsg" : "The $bucket 'boundaries' field must be an array, but found type: object.", "code" : 40200, "codeName" : "Location40200"
So changing [0,5,10,15] to {$range: [0,20,5]} creates the error.