It would be better to just return the common error
{
"REQUEST" : {
"op" : "update",
"args" : {
"updates" : [
{
"q" : {
"_id" : ObjectId("530fadb98e0e468e10a335f7"),
"x" : {
"$xyz" : 1
}
},
"u" : {
"a" : 1
}
}
]
}
},
"RESPONSE" : {
"ok" : 1,
"nModified" : 0,
"n" : 0,
"writeErrors" : [
{
"index" : 0,
"code" : 65,
"errInfo" : {
"causedBy" : [
{
"index" : 0,
"code" : 2,
"errmsg" : "unknown operator: $xyz"
},
{
"index" : 0,
"code" : 2,
"errmsg" : "unknown operator: $xyz"
}
]
},
"errmsg" : "multiple errors for op : unknown operator: $xyz :: and :: unknown operator: $xyz"
}
]
}
}