Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6772

After update, json elements reordered with _class element written by SpringData appearing before _id element. This was causing issues updating documents.

    • Type: Icon: Question Question
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.4
    • Component/s: Write Ops
    • None
    • Environment:
      EC2 SLES 11

      After running JS to atomically update a number of documents, document data was moved and JSON elements re-ordered. I think this is expected. When this happened, the _class element appeared before the _id element. This seemed to impacting the ability to update existing records. Updates were silently failing with no update to the document.

      Here's a snippet of the JSON:

      {
         "_class": "com.riskchecknow.datafactory.model.person.impl.PersonWatchImpl",
         "_id": "ObjectId("50254761e4b01356f16783f9")",
         "active": true,
         "createdAt": "ISODate("2012-08-10T17: 39: 45.226Z")",
         "shardk": {
           "value": "47onmsprlrvjrqtmbvgf29tuk8",
           "date": "ISODate("2012-08-01T04: 00: 00.0Z")" 
        },
         "updatedAt": "ISODate("2012-08-10T17: 39: 49.299Z")", ...
      

      Work around was to rename the collection, read through the renamed collection writing everything back the original collection.

      Is there a known bug that would prevent proper update behavior when _id is not the first element in the document?

            Assignee:
            ron.avnur Ron Avnur
            Reporter:
            bbientz@appriss.com Brian Bientz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: