Details
-
Bug
-
Resolution: Done
-
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.