Document object does not map to JSON causing data to be translated incorrectly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      he document object does not correctly translate JSON. It converts arrays into objects.
      This breaks some basic assumptions when expect an array but we end up getting object literals.

      Here is an example.

      Consider the following data is present in the MongoDB

      {"_id" : 5 , "arr" : [["one","two"],["three","four"],

      {"id" : "six"}

      ]}

      When you read this data using the driver the result is returned as a document.
      This document looks like

      { "_id": 5, "arr": { "0": [ "one", "two" ], "1": [ "three", "four" ], "2":

      { "id": "six" }

      } }

      The entire array is converted into an object.

            Assignee:
            Sam Corder
            Reporter:
            Syed Saleem Javid Brahmanapalli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: