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

$push error messages unclear

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:

      { "_id" : ObjectId("525847b17bb5149dea3bb07d"), "n" : 9, "x" : [  1 ] }
      > db.foo.update({ n : 9}, {$push: {x: {$each: [{"a.b" : 1}]}}})
      cannot use '$' in $each entries

      This error message makes no sense. Should probably be "cannot use dotted fields in $each entries" or some such.

      =======

      > db.foo.update({ n : 9}, {$push: {x: {$each: [{a:1},{a:2}], $xxx: -1, $sort:{a:1}}}})
      unrecognized clause is $push

      Should be "in" not "is".

      =======

      > db.foo.update({ n : 9}, {$push: {x:{$each:[{a:1},{a:2}], $slice:-2.0, $sort:{a:1}, $sort:{a:1}}}})

      According to db/ops/modifier_push_test.cpp line 463 this should ASSERT_NOT_OK but no error is thrown. Ditto duplicate $slice and duplicate $each.

      =======

      ...will probably add more things here later...

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            amalia.hawkins@10gen.com Amalia Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: