Details
Description
This update
> db.test.update({x : 1}, {$push : {a : {$each : [3,4], $position : -1}}})
|
WriteResult({
|
"nMatched" : 0,
|
"nUpserted" : 0,
|
"nModified" : 0,
|
"writeError" : {
|
"code" : 2,
|
"errmsg" : "The $position value in $push must be positive."
|
}
|
})
|
correctly fails with the message "The $position value in $push must be positive.". The message is slightly incorrect though because valid values are positive and 0 (non negative).