Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8837

Better non-shard-key wo/multi from $where query error message

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • Sharding

      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.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: