| Steps To Reproduce: |
Run the following update on an empty collection that is sharded across multiple shards (e.g. in the sharded_collections_jscore_passthrough suite):
var res = db.runCommand({
|
update: 'coll',
|
updates: [{
|
q: {$expr: {$eq: ["$skey", "MongoDB"]}},
|
u: {skey: "$$targetKey"},
|
c: {targetKey: "MongoDB2"}
|
}]
|
});
|
We get an ok:1 response but should expect an error "Constant values may only be specified for pipeline updates", like:
{
|
"nModified" : 0,
|
"n" : 0,
|
"writeErrors" : [
|
{
|
"index" : 0,
|
"code" : 51198,
|
"errmsg" : "Write results unavailable from failing to target a host in the shard shard-rs0 :: caused by :: Constant values may only be specified for pipeline updates"
|
}
|
],
|
"ok" : 1,
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1696889411, 60),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
},
|
"operationTime" : Timestamp(1696889411, 58)
|
}
|
(That is the error output you get when the update does match document(s) in the collection.)
|
| Sprint: |
Cluster Scalability 2023-11-13, Cluster Scalability 2023-11-27, Cluster Scalability 2023-12-11, Cluster Scalability 2023-12-25, Cluster Scalability 2024-1-8, Cluster Scalability 2024-1-22, Cluster Scalability 2024-2-5, Cluster Scalability 2024-2-19 |