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

improve new update() error strings

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.5
    • Affects Version/s: 2.5.3
    • Component/s: Write Ops
    • Labels:

      > db.x.save({})
      > db.x.update({}, {$set: {'a.b': 1}, $inc: {a: 1}})
      Cannot apply $inc to a value of non-numeric type._id: ObjectId('52697da65d5cfc4b53b1838e') has the field a of non-numeric type Object
      

      There should be a space before _id and the field name should be quoted, as shown below:

      Cannot apply $inc to a value of non-numeric type. _id: ObjectId('52697da65d5cfc4b53b1838e') has the field 'a' of non-numeric type Object
      

      Further error string improvements are described in the comments.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: