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

Fix grammar errors in update

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 3.3.2
    • 2.6.0-rc0, 2.6.11, 3.2.1, 3.3.1
    • Write Ops
    • Fully Compatible
    • ALL
    • Hide

      var qa380_db = db.getSiblingDB("qa380");
      var coll = qa380_db.foo;
       
      coll.update({n : 0}, {$mul: {n : '' }})

      1. Error message: "Cannot increment with non-numeric argument:"
      Should be: "Cannot apply $mul to a value of non-numeric type."

      coll.update({ n : 9}, {$push: {x: {$each: [1, 2], $slice: {a: 1}}}})

      2. Error message: "The value for $slice must be a numeric value not a Object"
      Should be: "The value for $slice must be a numeric value not an Object"

      coll.update({n : 10}, {$push: {x: {$sort:{a:1}}}})

      3. No longer generates an error (it did in 2.5.x): "$sort is not valid for storage."

      coll.update({n : 4}, {$push: {x: {$each:[{a:3},{a:2},{a:1}],$sort:{a:-1}}}})

      4. No longer generates an error (it did in 2.5.x): "The field 'x' must be and array but is of type NumberLong64 in document"

      coll.update({n:4},{$bit:[]})

      5. Error message: "Modifiers operate on fields but we found a Array instead"
      Should be: "Modifiers operate on fields but we found an Array instead"

      Show
      var qa380_db = db.getSiblingDB("qa380"); var coll = qa380_db.foo;   coll.update({n : 0}, {$mul: {n : '' }}) 1. Error message: "Cannot increment with non-numeric argument:" Should be: "Cannot apply $mul to a value of non-numeric type." coll.update({ n : 9}, {$push: {x: {$each: [1, 2], $slice: {a: 1}}}}) 2. Error message: "The value for $slice must be a numeric value not a Object" Should be: "The value for $slice must be a numeric value not an Object" coll.update({n : 10}, {$push: {x: {$sort:{a:1}}}}) 3. No longer generates an error (it did in 2.5.x): "$sort is not valid for storage." coll.update({n : 4}, {$push: {x: {$each:[{a:3},{a:2},{a:1}],$sort:{a:-1}}}}) 4. No longer generates an error (it did in 2.5.x): "The field 'x' must be and array but is of type NumberLong64 in document" coll.update({n:4},{$bit:[]}) 5. Error message: "Modifiers operate on fields but we found a Array instead" Should be: "Modifiers operate on fields but we found an Array instead"

    Description

      Based on testing (QA-380) in 2.5 and 2.6 there were many changes to the WriteResult. Some error messages are no longer generated or are syntactically or grammatically incorrect.

      Attachments

        Activity

          People

            james.wahlin@mongodb.com James Wahlin
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: