[SERVER-66787] [CQF] Translate $type for min and max bounds for indexes Created: 26/May/22  Updated: 05/Dec/22

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Svilen Mihaylov (Inactive) Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

Consider cases where it is possible to translate $type into a range (conjunction of two comparisons). For example, {$type: "string"} can be (ComposeM (Compare Gte "") (Compare Lt {})).



 Comments   
Comment by David Percy [ 31/May/22 ]

https://www.mongodb.com/docs/v5.0/reference/operator/query/type/

Couple ideas for things to check for:

  • Array traversal. It sounds like [5] matches both {$type: 'array'} and {$type: 'number'}, which makes sense because it matches both {$eq: 5} and {$eq: [5]}.
  • Individual numeric types. I think we can we make bounds for {$type: 'number'} but not {$type: 'int'}.
Generated at Thu Feb 08 06:06:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.