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

ObjectId not deserializing from json to its original value

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON, POJO
    • None

      I have a rest api which reads a document from mongo collection and one more API which adds/updates the document into the same collection.

       

      I have upgraded project to Spring-data-mongo 2.4.3 and now I have a problem.

       

      Below is Objectid for a row

       

      57d7171c02666d68cb2ec50b

      It translates to the corresponding json

      { "timestamp": 1473713948, "counter": 3065099, "randomValue1": 157293, "randomValue2": 26827 }

      and in API response I get below output

      {{ "id":

      { "timestamp": 1473713948, "counter": 3065099, "randomValue1": 157293, "randomValue2": 26827 }

      ,
      "product": "ABCD"}

       

      Now if I update the product name to something else and use the second API to post the same content, instead of updating the row, it is creating a different row.

      *{{ "id":

      { "timestamp": 1473713948, "counter": 3065099, "randomValue1": 157293, "randomValue2": 26827 }

      ,*
      "product": "EFGH"}

       

      Now the new ObjectId for new row is below

      57d7171c07430961eb07d9e2

       

      Intrestingl both translates to the same json as above.**

       

      this is happening in latest version of spring-data-mongo only.... earlier version 2.0.1 is good.****

      Not sure if the issue is with BSON ID, or JACKSON or MONGO DRIVER itself.****

       

      Please assist us on this issue.****

       

       

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            lingared@adobe.com Subash Lingaredd
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: