Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4198

BasicDBObject.toString() returns STRICT extended JSON, expecting RELAXED

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 3.7.0, 3.12.0
    • Component/s: BSON, JSON
    • Labels:

      Older versions (pre-3.7) of the driver when calling BasicDBObject.toString() returns simple JSON output, i.e

      {
         "name""foo", 
         "age" : 10}
      

      New versions (3.7 to 3.12), when calling the BasicDBObject.toString() method returns STRICT extended json: i.e

      {
         "name" :  "foo", 
         "age" : {"$numberLong": 10"}
      }
      

      Would it is possible to override the default behavior by some flag instead of using the BasicDBObject.toJson(JsonWriterSettings). Some applications rely on the prior behavior to feed other libraries that doesn't expect extended json.
       

            Assignee:
            Unassigned Unassigned
            Reporter:
            adamo.tonete@mongodb.com Adamo Tonete (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: