When trying to parse the following query:
{ $query : { author : { $regex : /^Oscar/ } }, $orderby : { name : 1 } }
we end up with the following error:
org.bson.json.JsonParseException: JSON reader expected a string but found 'BsonRegularExpression{pattern='^Oscar', options=''}'. at org.bson.json.JsonReader.visitRegularExpressionExtendedJson(JsonReader.java:940) at org.bson.json.JsonReader.visitExtendedJSON(JsonReader.java:587) at org.bson.json.JsonReader.readBsonType(JsonReader.java:139)
This is due to the fact that JsonReader#visitRegularExpressionExtendedJson is not prepared to get directly an already parsed BsonRegularExpression.
This is kinda annoying because we can't support this type of native query in Hibernate OGM.
PR to come.
- duplicates
-
JAVA-2447 Implement Extended JSON specification
- Closed