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

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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Works as Designed
    • Icon: Unknown Unknown
    • None
    • 3.7.0, 3.12.0
    • BSON, JSON

    Description

      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.
       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: