Skip to content

Commit c8019a6

Browse files
committed
Iterating on regex LIKE clause fix
1 parent 0e22a20 commit c8019a6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/picoded/dstack/mongodb/MongoDB_DataObjectMap.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ static protected Bson queryObjToBsonFilter(Query inQuery) {
365365
String val = GenericConvert.toString(inQuery.defaultArgumentValue());
366366

367367
// val = val.replaceAll("*", "*");
368-
val = val.replaceAll("*", Pattern.quote("*"));
369-
val = val.replaceAll("%", ".*");
370-
val = val.replaceAll("_", "[.]");
368+
val = val.replaceAll("\\*", "*");
369+
val = val.replaceAll("\\%", ".*");
370+
val = val.replaceAll("\\_", "[.]");
371371

372372
return Filters.regex(inQuery.fieldName(), "^"+val+"$");
373373
}

0 commit comments

Comments
 (0)