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

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Trivial - P5
    • Resolution: Won't Fix
    • None
    • None
    • Sharding

    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.

      Attachments

        Activity

          People

            backlog-server-sharding Backlog - Sharding Team
            scotthernandez Scott Hernandez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: