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

update fails when field contains more than 1012 characters

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.2, 2.4.1
    • Component/s: None
    • None
    • Environment:
      Reproduced on:
      - linux64 bits vith version 2.4.1
      - windows7 64 bits with version 2.2.2
    • ALL
    • Hide

      Running mongo shell:

      var c = db.test;
      c.drop();
      c.ensureIndex({'x' : 1});
      c.insert({'_id' : 1, 'x' : Array(1012).join('a')});
      c.insert({'_id' : 2, 'x' : Array(1013).join('b')})
      c.find().forEach(function(o) {
      	c.update(o, {'$set' : { x : 'new x'}});
      })
      c.find().forEach(function(o) {
      	printjson(o);
      })
      

      Returns:

      { "_id" : 1, "x" : "new x" }
      { "_id" : 2, "x" : "bbbbbbbbbbbbbbbbbb....."}
      
      Show
      Running mongo shell: var c = db.test; c.drop(); c.ensureIndex({ 'x' : 1}); c.insert({ '_id' : 1, 'x' : Array(1012).join( 'a' )}); c.insert({ '_id' : 2, 'x' : Array(1013).join( 'b' )}) c.find().forEach( function (o) { c.update(o, { '$set' : { x : ' new x' }}); }) c.find().forEach( function (o) { printjson(o); }) Returns: { "_id" : 1, "x" : " new x" } { "_id" : 2, "x" : "bbbbbbbbbbbbbbbbbb....." }

      Passing an object that has an indexed field with a value longer than 1012 to the update function fails to update:
      In java the WriteResult says no error but getN() returns 0

            Assignee:
            Unassigned Unassigned
            Reporter:
            niconico nicholas wolff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: