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

mongo::fromjson failed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Works as Designed
    • 2.4.1, 2.4.2
    • None
    • Internal Client
    • Linux
    • ALL
    • 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

            sverch Shaun Verch
            fredix Frédéric Logier
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: