JsonReader does not support BsonRegularExpression

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • 3.5.0
    • Affects Version/s: 3.0.0
    • Component/s: JSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Guillaume Smet
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: