Update using '$id', '$db', and '$ref' are acceptable field names in subdocs fails

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.4.6, 2.5.4
    • Component/s: Write Ops
    • None
    • Environment:
      Standalone, OSX
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Test failure in QA-322/dollarsigns.js

      // Test that '$id', '$db', and '$ref' are acceptable field names in
      // the correct case (ie, subdoc) but not otherwise.
      // SERVER-3231
      coll.update(

      { n: 0 }

      , { $set: { $id: 1, $db: 1, $ref: 1 }});
      var gle = db.runCommand(

      { getLastError: 1 }

      );
      assert(gle.err != null, 'gleObj: ' + tojson(gle));
      coll.update(

      { n: 0 }

      ,

      { n: 0 }

      );

      coll.update(

      { n: 0 }

      , { $set: { 'x.$id': 1, 'x.$db': 1, 'x.$ref': 1 }});
      var gle = db.runCommand(

      { getLastError: 1 }

      );
      assert(gle.err == null, 'gleObj: ' + tojson(gle));
      coll.update(

      { n: 0 }

      ,

      { n: 0 }

      );

      Assert thrown from second update:

      2013-12-12T12:39:01.485-0500 assert failed : gleObj:

      { "err" : "The DBRef $db field must be a String, not a NumberDouble", "code" : 55, "n" : 0, "connectionId" : 171, "ok" : 1 }

      at src/mongo/shell/assert.js:7

            Assignee:
            Unassigned
            Reporter:
            Jonathan Abrahams (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: