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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.4.6, 2.5.4
    • Write Ops
    • None
    • Standalone, OSX
    • ALL

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: