@ -779,7 +779,11 @@ public class Criteria implements Predicate {
} else if (leftNullish && rightNullish) {
return 0;
} else if (left instanceof String && right instanceof String) {
return ((String) left).compareTo((String) right);
String exp = (String)left;
if(exp.contains("\'")){
exp = exp.replace("\\'", "'");
}
return exp.compareTo((String) right);
} else if (left instanceof Number && right instanceof Number) {
return new BigDecimal(left.toString()).compareTo(new BigDecimal(right.toString()));
} else if (left instanceof String && right instanceof Number) {
@ -497,4 +497,20 @@ public class IssuesTest {
Assertions.assertThat(problems).containsExactly("Chain does not have a discovery event. Possible it was cut by the date that was picked", "No start transcoding events found");
@Test
public void issue_71() {
String json = "{\n"
+ " \"logs\": [\n"
+ " {\n"
+ " \"message\": \"it's here\",\n"
+ " \"id\": 2\n"
+ " }\n"
+ " ]\n"
+ "}";
List<String> result = JsonPath.read(json, "$.logs[?(@.message == 'it\\'s here')].message");
Assertions.assertThat(result).containsExactly("it's here");