[JAVA-4892] Add support for $regexMatch Created: 21/Feb/23  Updated: 16/Mar/23

Status: Backlog
Project: Java Driver
Component/s: Builders
Affects Version/s: None
Fix Version/s: None

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


 Comments   
Comment by Maxim Katcharov [ 28/Feb/23 ]

Prior to 4.9.0, none of the expression operators were yet implemented, so they needed to be built up "manually" in the manner I described above. We added many but not all in JAVA-3879, which we just released as beta. (Unfortunately, regexMatch was not part of the initial batch.) If things go well, we'll move on to implementing the rest of the operators.

Comment by Bobby Tiernay [ 28/Feb/23 ]

I'm not. I was trying to do this via `com.mongodb.client.model.Aggregates` and `com.mongodb.client.model.Filters`. I notice that some operators are there, while others are not. Curious as to the rationale.

Comment by Maxim Katcharov [ 28/Feb/23 ]

bob.tiernay@auth0.com  Could you give more details, and a code snippet if possible? Are you using the com.mongodb.client.model.mql package added in 4.9.0?

You might be able to use something like the following:

FindIterable<Document> iterable = collection.find(expr(
        new Document("$regexMatch", new Document()
                .append("input", "$name")
                .append("regex", "..."))));

Comment by Bobby Tiernay [ 21/Feb/23 ]

Currently, $regexMatch is not supported in the Java driver.

Generated at Thu Feb 08 09:03:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.