Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1406

Error Reading JavascriptWithScope in JsonReader

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: 3.0.0
    • Component/s: JSON
    • Labels:

      The following code produces an error

       def c = '{"codeWithScope": {
          "$code": "int x = y",
          "$scope": {
            "y": 1
          }
        }
      }'
      
      new DocumentCodec().decode(new JsonReader(c), DecoderContext.builder().build())
      

      Error: org.bson.json.JsonParseException: JSON reader was expecting a name but found '{'.

            Assignee:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: