[SERVER-81317] Rewrite conjunction $expr expressions for time-series matches on the timeField Created: 21/Sep/23  Updated: 03/Feb/24

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

Type: Improvement Priority: Major - P3
Reporter: Gil Alon Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: qi-timeseries
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Integration
Participants:

 Description   

We currently do not create a wholeBucketFilter for conjunction match predicates like this for time-series:

{$expr: {$and: [ {$gt: ['$time', <start time>]}, {$lt: ['$time', <end time>]}]}}

We don't do this because for $expr predicates we call createPredicate and not createPredicatesOnBucketLevelField here. However, we can call createPredicatesOnBucketLevelField to recur down the match expression. However, we need to confirm that the predicate is just on the timeField. If createPredicatesOnBucketLevelField is called on this predicate:

{$expr: {$or: [ {$gt: ['$time', <start time>]}, {$eq: ['$meta', 3]}]}} 

a document with the metaField [\{b: 2}, \{b:3}] was returned, which is incorrect.

 


Generated at Thu Feb 08 06:46:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.