[SERVER-6257] add a $inOrder operator to $project Created: 29/Jun/12  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Mathias Stearn Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: expression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

currently range tests need to be written like this:

        {
                "$project" : {
                        "in_range" : {
                                "$and" : [
                                        {
                                                "$gt" : [
                                                        "$count",
                                                        10
                                                ]
                                        },
                                        {
                                                "$lt" : [
                                                        "$count",
                                                        100
                                                ]
                                        }
                                ]
                        },
                        "count" : 1
                }
        }

It would be nice to write this as {'in_range': {$inOrder:[10, '$count', 100]}}

Naming is to be more clear when there are >3 arguments.



 Comments   
Comment by Asya Kamsky [ 28/May/19 ]

I think $switch makes this less relevant...

 

Generated at Thu Feb 08 03:11:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.