[DOCS-9478] Docs for SERVER-27152: Accept expressions (e.g. $range) for the 'boundaries' argument to $bucket. Created: 02/Dec/16  Updated: 21/Jan/18  Resolved: 21/Jan/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Jonathan DeStefano
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 3 weeks, 4 days ago

 Description   

Engineering Ticket Description:

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.



 Comments   
Comment by Kay Kim (Inactive) [ 21/Jan/18 ]

ticket maker script was a bit aggressive in opening tickets before engineering ticket is even slated for work

Generated at Thu Feb 08 07:58:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.