[COMPASS-3391] aggregation pipeline builder does not support combined $or and ObjectId('') in $match Created: 16/Jan/19  Updated: 29/Oct/23  Resolved: 17/Mar/20

Status: Closed
Project: Compass
Component/s: Aggregation pipeline, Compass, Grammar
Affects Version/s: 1.16.3
Fix Version/s: 1.22.0

Type: Bug Priority: Major - P3
Reporter: Brian Blevins Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2019-01-16-13-17-47-279.png    
Issue Links:
Problem/Incident
causes COMPASS-4146 Disable validation in agg builder, qu... Closed

 Description   

 

The aggregation pipeline builder will allow a $match stage with either an ObjectId('') expression or a $or expression.  However, it will not allow those two to be combined.  Please refer to the attached screenshot.

 

{
  $or: [
    {'start time': {$gte: ISODate('2016-02-21T11:23:47.000Z')}},
    {'end time': {$gte: ISODate('2016-02-21T11:23:47.000Z')}}
  ],
  _id:ObjectId('572bb8222b288919b68adfa5')
}

 

In brief testing, combining ObjectId('') with other expressions appears to work.  Combining $or with other expressions appears to work.

 

 


Generated at Wed Feb 07 22:33:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.