> coll.update({n : 0}, {$bit : { x : { foo : NumberInt(1) } }}) Only 'and', 'or', and 'xor' are supported $bit sub-operators
> coll.update({n : 0}, {$bit : { n : { foo : 2 } }}) Argument to $bit operation must be a NumberInt or NumberLong
I believe that the "sub-operators" error message in the first call should trigger in the second case as well. In other words, if the sub-operator and the argument to the sub-operator are both wrong, the sub-operator error message should trigger first.
Relatedly, "Argument to $bit sub-operation" is probably more correct than the current form.
=======
{ "_id" : ObjectId("525847b17bb5149dea3bb07e"), "n" : 0, "x" : 0 } > coll.update({n : 0}, {$bit : { x : { or : NumberInt(1) } }}) Cannot apply $bit to a value of non-integral type
I think the error message should say something like, "cannot apply $bit to a value that is not NumberInt nor NumberLong".
=======
> db.foo.update({ n : 0 }, {$bit: {str : "hello"}}) Value following $bit must be an Object
It is an Object!
> db.foo.update({n:4},{$bit:[]}) List of mods must be an object
Shouldn't this error message be the one above?
- related to
-
SERVER-11366 improve new update() error strings
-
- Closed
-