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

Error Reading JavascriptWithScope in JsonReader

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.0.0
    • 3.0.0
    • JSON

    Description

      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 '{'.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: