[SERVER-8837] Better non-shard-key wo/multi from $where query error message Created: 04/Mar/13  Updated: 06/Dec/22  Resolved: 12/Jul/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Scott Hernandez (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: logging, messages, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Participants:

 Description   

This error message can be made more specific with more context:

mongos> db.a.update({$where:"this.sk==1"}, {$set:{foo:1}})
can't do non-multi update with query that doesn't have a valid shard key

Into something like this:

Cannot find shard key (<key>) in the query (<query>) which is required for non-multi update. [Javascript $where queries are not supported for this operation]

Where the query and shard key are included. In this case the $where should be called out as not supported as well.


Generated at Thu Feb 08 03:18:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.