[COMPASS-2987] Aggregations :: $match :: $regex , $options - can't be setted Created: 10/Jul/18  Updated: 27/Oct/23  Resolved: 25/Jul/18

Status: Closed
Project: Compass
Component/s: Aggregation pipeline
Affects Version/s: 1.14.6
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Filipp Akinfiev Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Compass 1.14.6 MacOS, MongoDB 4.0 Ubuntu



 Description   

Using of $options for $regex in aggregations $match stage like - 

 

{ name: { $regex: /^PA/, $options: 'i' }}

indicate an error:

 

Expected "[" or AggregationStage but "{" found. 

 



 Comments   
Comment by Durran Jordan [ 25/Jul/18 ]

We don't support extended JSON in the stages so you can do this by using the actual object the shell exposes: RegExp('^PA', 'i)

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