Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-16

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: