Add ability to print/decode top level JSON Array

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 2.7.3
    • Affects Version/s: None
    • Component/s: Usability
    • None
    • Fully Compatible
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The JSON RFC that arrays are valid top-level JSON objects:

         A JSON text is a sequence of tokens.  The set of tokens includes six
         structural characters, strings, numbers, and three literal names.
      
         A JSON text is a serialized object or array.
      
            JSON-text = object / array
      

      This ticket is for adding the ability to test for and parse arrays in strings as well as the ability to print them. Example usage:

      StringData json("[ 123, \"abc\", ... ]");
      if (isArray(json)) {
          BSONArray arr = fromjson(json);
          std::cout << printjson(arr) << std::endl;
      }
      

            Assignee:
            Tyler Brock (Inactive)
            Reporter:
            Tyler Brock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: