[CDRIVER-4769] Support parsing $regex query operator appearing in Extended JSON Created: 06/Nov/23  Updated: 07/Nov/23

Status: Backlog
Project: C Driver
Component/s: Extended JSON
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Unknown
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-2316 Ignore $regex when parsing Relaxed Ex... Blocked
Quarter: FY25Q1

 Description   

libbson currently provides no mechanism that would allow parsing a $regex query operator in an Extended JSON document, as it always interprets it as legacy BSON gegex type.

Quoting Parsers from the Extended JSON spec:

A parser that accepts Legacy Extended JSON MUST be configurable such that a JSON text of a MongoDB query filter containing the regex query operator can be parsed, e.g.:

{ "$regex": {
    "$regularExpression" : { "pattern": "foo*", "options": "" }
  },
  "$options" : "ix"
}

or:

{ "$regex": {
    "$regularExpression" : { "pattern": "foo*", "options": "" }
  }
}

This is also discussed in:


Generated at Wed Feb 07 21:21:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.