Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9414

mongo::fromjson failed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: 2.4.1, 2.4.2
    • Fix Version/s: None
    • Component/s: Internal Client
    • Labels:
    • Environment:
      Linux
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      string json = "

      { \"A\": 1, \"B\":2 }

      ";
      BSONObj test = mongo::fromjson(json);
      failed with this exception :
      code FailedToParse: FailedToParse: Expecting '}' or ',': offset:9

      string json = "

      { \"A\": 1 , \"B\":2 }

      ";
      with the white space after 1, it works.

      Show
      string json = " { \"A\": 1, \"B\":2 } "; BSONObj test = mongo::fromjson(json); failed with this exception : code FailedToParse: FailedToParse: Expecting '}' or ',': offset:9 string json = " { \"A\": 1 , \"B\":2 } "; with the white space after 1, it works.

      Description

      mongo::fromjson is failed if there is no white space before comma when the value is an int.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: